PLEASE NOTE: RVM is 'hands off' any system ruby that you have installed. NOTE: Ruby switched to a Semantic Versioning scheme as of Ruby 2.1.1, which might affect your use of rvm to manage it. It goes by what is maintained in those two files. RVM does not go by what you have installed for this reason. 2.1.2 at the time of writing) can change on you. RVM updates the known list ($rvm_path/config/db and $rvm_path/config/known) every time you update RVM, so the 'current' version of a Major.Minor (e.g. If its not, then be sure to include the patch level when you specify which Ruby RVM should use when setting a default. This behaviour may, or may not, be what you want. For example, if you only have 2.0.0-p451 installed, and 2.0.0-p481 is the latest, RVM will attempt to download, install, and set 2.0.0-p481 as your default 2.0.0 for you. NOTE: If you use just the Major.Minor version numbers, RVM checks for, and uses, what is the most current patchlevel in its $rvm_path/config/db for that Major.Minor version. # MRI Ruby 2.1.1, and sets it as default. # This changes to whatever RVM recognizes as the most current # you previously had a different Ruby selected (maybe JRuby) # You use the following full form if, for example, ![]() # This changes to jruby-head and _does_ set it as # The following changes to ruby-head (MRI Ruby) but does _not_ Below is an example of what I mean: # This changes to MRI Ruby 2.1.1 and sets it as your default. ![]() This also applies when setting a default Ruby. If its a -head version use the full string as it will notĬontain numbers. However, do note that when you are switching between an MRI or Rubinus, or REE,Īs an example, then you need to use the ree|ruby|rbx part. This is just used to indicate the differences between, say, REE rubies, and It is not required to include the 'ruby-' portion of whatever is listed in the output of rvm list for installed rubies. NOTE: There has been some confusion amongst new users as to the proper way to switch between Ruby For example, for Ruby 2.1.1: $ rvm use 2.1.1 Once you have installed a Ruby interpreter with RVM successfully you may then use it by executing the use command. As an example, to install and use Ruby 2.1.1 you may do: $ rvm install 2.1.1 ∞Installing rubiesĪssuming this shows "rvm is a function", you're good to go. It would mean though, that you have to manage dependencies manually. ![]() If you want to be able to run RVM commands by the user who does not have sudo rights, you would need to turn off automatic dependency installation: rvm autolibs disable Make sure that user, who calls RVM commands, especially rvm install, have sudo rights. When installing rubies, RVM might need to use sudo to install dependencies. To do this, and verify that RVM is loaded as a shell function, run: type rvm | head -1 ∞Automatic dependencies installation rvm needs to load for both interactive and non-interactive shells which is why it strongly is recommended to alter this file.įirst ensure that the previous step was successful and that rvm is loaded correctly. The condition is true if the string "$PS1" has zero length (a non-interactive shell). bashrc) contains the following line: & return In a few linux distributions, the default. You should now open a new shell and start playing with rvm.Ī note about the. Then, when you login or spawn a shell this will automatically load RVM regardless of the shell type. This means using rubies is not possible in this mode, but there are simple methods to load ruby: source $(rvm 1.9.3 do rvm env -path) In case of problems use one of following links as reference for configuring your terminal:įor non-interactive shells RVM will be added to PATH only, not loaded. When you log in either via ssh or the local shell account RVM will be loaded as a function. RVM also lets you use different rubies in a manner that won't mess with your existing ruby install (unless you tell it to) as well as letting you run multiple different rubies in separate terminals concurrently! ∞Getting startedįirst, you must ensure that you install RVM. Wondering why you should use RVM? For a start, not only does RVM make installing multiple ruby interpreters / runtimes easy and consistent, it provides features such as gemsets that aren't typically supported out of the box on most ruby installs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |