Code Monkey home page Code Monkey logo

rvm-test's Introduction

Tests GPG signature check OpenCollective OpenCollective

What's RVM

RVM is the acronym of Ruby enVironment Manager. It manages Ruby application environments and enables switching between them.

Homepage and more info at https://rvm.io

Table of Contents

Installing RVM

Ubuntu

RVM have dedicated Ubuntu package, so please follow instructions posted here: https://github.com/rvm/ubuntu_rvm

If you need a different (newer) version of RVM, after installing base version of RVM check the Upgrading section below.

Any other operating system

Make sure you have following required packages installed:

  • curl
  • gpg2

And then run:

\curl -sSL https://get.rvm.io | bash -s stable

Additional installation options

Additional installation options and details about the installation process are described here: https://rvm.io/rvm/install

Upgrading RVM

You can upgrade RVM any time by running:

rvm get VERSION

Where VERSION should be replaced by one of the following values:

  • stable - latest stable RVM (good for servers)
  • master - latest RVM (might not be stable)
  • branch /path/branch - branched version of RVM (for testing new features or bug fixes)

Additional upgrading options are described here: https://rvm.io/rvm/upgrading

Basic RVM usage

Basic RVM usage scenarios include installing and switching between different ruby versions.

Installing ruby

To install ruby you have to call rvm install INTERPRETER[-VERSION] OPTIONS

When no version specified, RVM will install latest stable version or selected interpreter. If you omit to specify interpreter, RVM will assume that you wanted to install MRI ruby. Following examples would have exactly the same effect:

rvm install ruby-2.3.1
rvm install ruby-2.3
rvm install 2.3.1
rvm install 2.3

Passing additional --default option makes selected ruby your default.

We currently supported following ruby interpreters:

  • ruby - MRI ruby (The Gold Standard)
  • ironruby - a .NET ruby
  • jruby - Java implementation of the ruby
  • macruby - implementation of ruby 1.9 directly on top of macOS core technologies
  • maglev - 64-bit implementation on top of VMware's GemStone
  • mruby - lightweight ruby
  • opal - ruby to JavaScript compiler
  • rbx - Rubinius - a next generation virtual machine VM for ruby
  • topaz - high performance ruby, written in RPython
  • truffleruby - high performance ruby using GraalVM

Historical interpreters which you can still install with RVM, but are not anymore developed and supported by their authors:

  • ree - Ruby Enterprise Edition - MRI Ruby with several custom patches for performance, stability, and memory

Switching between ruby versions

To switch between ruby versions you should call

rvm use INTERPRETER[-VERSION]

Same rules and options apply as for install command with two special interpreters.

  • default - default ruby (or the system ruby if a default hasn't been set)
  • system - system ruby (state before RVM was installed)

Additionally you might want to list your preferred ruby version in a .ruby-version file stored in your project folder. This would cause automatic switch to selected ruby whenever you enter the folder.

Other RVM commands

RVM comes bundled with many different tools for managing your ruby environment. More detailed information about every command listed below can be read after executing rvm help COMMAND or browsing documentation on RVM homepage https://rvm.io.

Reporting issues

Here at RVM we get a high amount of bug reports, and often they are connected with specific environment settings which might be hard for us to replicate. That's why we would kindly ask you to follow the steps below so we can maximize our time helping you and minimize the time requesting more information.

Check documentation

We know, you hear this over and over and be rest assured we are working hard to improve the usability of https://rvm.io but we must always ask that you first please check the documentation if you are requesting a feature or if you are not sure if you did it right.

Try again with latest RVM

We try to release a new RVM as soon as we feel that we achieved certain stability. This might take a while and it could be the case that your issue has been already resolved in our development branch. Please get the latest RVM and try again:

rvm get master

File an issue

If the documentation is not clear, an error message is not clear or you are stuck with the problem, please do file a bug.

When in doubt as to whether your issue might relate to another, simply file a new bug, and we will mark it as duplicate if it needs to be. It's always better to file a new ticket and let us sort it out than to accidentally add noise to another ticket.

For filing issues, we have prepared a template for you to use. Please try to fill all sections as best as you can. Always make sure to split up each command and its output into its own fenced code block. If the output is long, please put it in a separate gist. Otherwise it's hard for us to process all the information and respond quickly.

Note that if there is a lot of debug or trace output you can redirect it to a file with the > character like rvm [command] > output.txt.

Contributing

You are very warmly welcome to help. Please follow our contribution guidelines

Any and all contributions offered in any form, past present or future are understood to be in complete agreement and acceptance with our Apache License v2.0.

Backers

Become a backer and support us with a small monthly donation to help us continue our activities. Thank you if you are already one of them! ๐Ÿ™

Backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

Sponsors

License

Copyright (C) Michal Papis (2011-2021), Piotr Kuczynski (2016-2021), Wayne E. Seguin (2009-2011)

Licensed under the Apache License, Version 2.0

rvm-test's People

Contributors

adzap avatar carols10cents avatar colindean avatar eregon avatar iced avatar kjperry avatar mpapis avatar pkuczynski avatar richo avatar slyphon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rvm-test's Issues

Next Evolution of process transparency

This is from a conversation I had with @mpapis in #beginrescueend on freenode about what I wanted. I was trying to speak out the conceptual idea i was playing with. This is the results:


11:01:05   deryl: can anyone recommend a gem to fulfill the need inherent in the idea of using ruby to launch, break apart, and monitor all aspects of the bash environment and scripts executed via %x[], ``, or exec (heck even direct System is fine) and to be able to generate and cull logging?
11:01:25   deryl: basically trying to extend the level of information captured from rvm-test testruns which contain ruby and bash commands to execute.
11:01:36   deryl: i'd like to be able to execute a single, batched, or Marshalled replay and be able to capture all (and eventually named) environmental variables, std*, library calls, OS system calls, and timing blocks for commands.
11:01:49   deryl: is there a gem that already contains the mechanics of the different aspects of that?
11:01:56   deryl: or is this a 'too wide, you'll have to write your own to include the mechanicals like accessing executed commands, spawned-environment vars, etc
11:01:58   deryl: "
11:06:03   mpapis: deryl:  does any of the popen2-4 does that ?
11:07:33   deryl: mpapis, some
11:07:54   deryl: going to have to read deeper into IO i guess
11:08:55   mpapis: know your tools ;)
11:09:16   deryl: yeah yeah ;p
11:14:32   deryl: mpapis, basically I wanted to know if there was something already developed. I'm sure I'm not the first one to want to get to all aspects of the lifecycle of a file and its own spawned-environment. There are certain call structures that are the same regardless of the value of the cmdstring. there's also known debugging points and what txt they would generally generate. 
11:15:01   deryl: i thought there might possibly be a gem already built with that information exposed 
11:15:24   deryl: rather than having to write all of it on my own, though i certainly will do so if there isn't one.
11:15:53   deryl: this is me casting about
11:23:58   mpapis: there has to be something to work interactively with shell session ... if there is not i would be disappointed
11:25:35   deryl: i'm wondering if i'm thinking more performance monitoring than i actually am debugging
11:26:14   deryl: i mean i want to pull as much output as possible with control on the level of that flow, but i'm really just examining that return. i'm not modifying it
11:26:53   deryl: it'll be used elsewhere in the program but all i'm really trying to pull out is all the details associated with the full lifecycle of a single process.
11:27:13   deryl: anything that could be used for decision making.
11:28:22   deryl: if i have the full output of the environment of whatever is being executed (such as set +x information for the bash shell the command is exec'd in, and --trace information from rvm itself)
11:29:11   deryl: then we can key in on things like sm console does where you can set traps for environment variables. if I report that trap back up to the suite itself, I can monitor changes 
11:30:09   deryl: i can make decisions in that process and back higher at the report level to do things like modify the running process, or perhaps generate an additional gist of that portion of the command's environment
11:30:14   mpapis: interesting
11:31:05   deryl: basically, i want to peer in deeper at each aspect of each command that run.rb has thrown at it
11:31:21   deryl: pull that data
11:31:27   deryl: make decision trees out of it
11:32:42   mpapis: i would move debugging for later, first - one session - second tests, they give more value and should be easier to implement
11:33:35   deryl: will also aid in expanding TestSet (which I'm about to add Model wise) encapsulation. We see that this TestSet contains the commands to install rbx, and create a gemset. We have X number of TestReports associated with this test set that makes use of the same commands. Lets pull prior records where these commands were the same and see what the rvm_path was set to at what stage in the process. 
11:34:29   deryl: For those specific portions of the command set thats used to start and complete the rbx installation portion.
11:35:31   mpapis: ah so you move output of command to the connection between command and test case ?
11:35:44   deryl: by storing the environment of each command you can create an Environment model which has_many :commands and if you link certain command sequences to the Environment, then those particular command's previous environments become available
11:36:22   deryl: and you can rerun commands for a specific environment simply by including the Environment object in your TestSet. Multiple Environments of course being allowed.
11:36:37   deryl: mpapis, exactly

So in the end, we'd end up with something like this:

TestSet = (x.times TestCase[ x.times TestReport[:commands] + x.times Environment[:testreports] ]) where TestReport[:commands] is the TestCase's test_report for the commands to be run under that TestCase, coupled with the known Environments that contain prior TestReports where their commands matched the ones you're running.

Commands to manage all of this are in TestSet, which in turn could be controlled by becoming members of a TestBank.

comment tests

Add possibility to define tests in comments to commands, example:

rvm use missing # status!=0
rvm use 1.9.2      # status!=0
rvm install 1.9.2  # status=0 string="Installed"
rvm use 1.9.2      # status=0 string="Using" lines=1
  • the comment test part should be stored in separate field in database
  • the tests are optional
  • the tests can be applied to any command - not only starting with rvm.

do_comment_test.sh has failures when run manually

do_comment_test.sh has failures when I run it manually:

$ tf --text fast/do_comment_test.sh
##### starting test do.
$ source "$rvm_path/scripts/rvm"
$ rvm use 1.8.7 --install
Using /home/adam/.rvm/gems/ruby-1.8.7-p374
# passed: status = 0
$ rvm gemset create test1
gemset created test1    => /home/adam/.rvm/gems/ruby-1.8.7-p374@test1
# passed: status = 0
$ rvm gemset create test2
gemset created test2    => /home/adam/.rvm/gems/ruby-1.8.7-p374@test2
# passed: status = 0
$ : do
$ rvm 9.9.9 do rvm gemdir
Unknown ruby interpreter version: '9.9.9'.
Ruby  is not installed.
# passed: status = 1
# passed: match = /is not installed/
$ rvm 1.8.7 do rvm gemdir
/home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/spec_set.rb:92:in `materialize': Could not find fattr-2.2.1 in any of the sources (Bundler::GemNotFound)
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/spec_set.rb:85:in `map!'
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/spec_set.rb:85:in `materialize'
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/definition.rb:114:in `specs'
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/definition.rb:159:in `specs_for'
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/definition.rb:148:in `requested_specs'
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/environment.rb:18:in `requested_specs'
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/runtime.rb:13:in `setup'
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler.rb:120:in `setup'
        from /home/adam/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.4/lib/bundler/setup.rb:17# failed: status = 0 # was 1
# failed: match = /1.8.7-p[[:digit:]]+/

Next Evolution of process transparency

This is froma conversation I had with @mpapis in #beginrescueend on freenode about what I wanted. I was trying to speak out the conceptual idea i was playing with. This is the results:

11:01:05   deryl: can anyone recommend a gem to fulfill the need inherent in the idea of using ruby to launch, break apart, and 
monitor all aspects of the bash environment and scripts executed via %x[], ``, or exec (heck even direct System is fine) and to be
able to generate and cull logging?
11:01:25   deryl: basically trying to extend the level of information captured from rvm-test testruns which contain ruby and bash commands to execute.
11:01:36   deryl: i'd like to be able to execute a single, batched, or Marshalled replay and be able to capture all (and eventually named) environmental variables, std*, library calls, OS system calls, and timing blocks for commands.
11:01:49   deryl: is there a gem that already contains the mechanics of the different aspects of that?
11:01:56   deryl: or is this a 'too wide, you'll have to write your own to include the mechanicals like accessing executed commands, spawned-environment vars, etc
11:01:58   deryl: "
11:06:03   mpapis: deryl:  does any of the popen2-4 does that ?
11:07:33   deryl: mpapis, some
11:07:54   deryl: going to have to read deeper into IO i guess
11:08:55   mpapis: know your tools ;)
11:09:16   deryl: yeah yeah ;p
11:14:32   deryl: mpapis, basically I wanted to know if there was something already developed. I'm sure I'm not the first one to want to get to all aspects of the lifecycle of a file and its own spawned-environment. There are certain call structures that are the same regardless of the value of the cmdstring. there's also known debugging points and what txt they would generally generate. 
11:15:01   deryl: i thought there might possibly be a gem already built with that information exposed 
11:15:24   deryl: rather than having to write all of it on my own, though i certainly will do so if there isn't one.
11:15:53   deryl: this is me casting about
11:23:58   mpapis: there has to be something to work interactively with shell session ... if there is not i would be disappointed
11:25:35   deryl: i'm wondering if i'm thinking more performance monitoring than i actually am debugging
11:26:14   deryl: i mean i want to pull as much output as possible with control on the level of that flow, but i'm really just examining that return. i'm not modifying it
11:26:53   deryl: it'll be used elsewhere in the program but all i'm really trying to pull out is all the details associated with the full lifecycle of a single process.
11:27:13   deryl: anything that could be used for decision making.
11:28:22   deryl: if i have the full output of the environment of whatever is being executed (such as set +x information for the bash shell the command is exec'd in, and --trace information from rvm itself)
11:29:11   deryl: then we can key in on things like sm console does where you can set traps for environment variables. if I report that trap back up to the suite itself, I can monitor changes 
11:30:09   deryl: i can make decisions in that process and back higher at the report level to do things like modify the running process, or perhaps generate an additional gist of that portion of the command's environment
11:30:14   mpapis: interesting
11:31:05   deryl: basically, i want to peer in deeper at each aspect of each command that run.rb has thrown at it
11:31:21   deryl: pull that data
11:31:27   deryl: make decision trees out of it
11:32:42   mpapis: i would move debugging for later, first - one session - second tests, they give more value and should be easier to implement
11:33:35   deryl: will also aid in expanding TestSet (which I'm about to add Model wise) encapsulation. We see that this TestSet contains the commands to install rbx, and create a gemset. We have X number of TestReports associated with this test set that makes use of the same commands. Lets pull prior records where these commands were the same and see what the rvm_path was set to at what stage in the process. 
11:34:29   deryl: For those specific portions of the command set thats used to start and complete the rbx installation portion.
11:35:31   mpapis: ah so you move output of command to the connection between command and test case ?
11:35:44   deryl: by storing the environment of each command you can create an Environment model which has_many :commands and if you link certain command sequences to the Environment, then those particular command's previous environments become available
11:36:22   deryl: and you can rerun commands for a specific environment simply by including the Environment object in your TestSet. Multiple Environments of course being allowed.
11:36:37   deryl: mpapis, exactly

So in the end, we'd end up with something like this:

TestSet = (x.times TestCase[ x.times TestReport[:commands] + x.times Environment[:testreports] ]) where TestReport[:commands] is the TestCase's test_report for the commands to be run under that TestCase, coupled with the known Environments that contain prior TestReports where their commands matched the ones you're running.

Commands to manage all of this are in TestSet, which in turn could be controlled by becoming members of a TestBank.

Single vs. Session based executions.

Figure out how to make it so that a user can execute all the commands in the batching file within the same environment / same session instead of opening a new session each and every command. Furthermore, make it do both by use of a parameter at the run.rb level. So state it plainly, either each command is executed independently, or a initializer opens an environment and each command is executed, without a session change, within that opened environment. Right now, all commands execute independently of each other serially though the chain. @mpapis suggested popen4 as a potential starting point.

This will naturally lead into Issue #2 completion.

Lacks cron and queueing capabilities

Need to add the ability to create cron jobs, and queue test runs. Also need notification feedback of job submittal and completion, with URL of job completion gist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.