![]() One can not have two different versions of RubyGems with same Ruby versions at the same time. Same Ruby Version with Different RubyGem VersionsĪ RubyGem version is tied to a Ruby version. If you install a different RubyGems via the 'rvm rubygems' API and decide to go back to the built in then you can run the following command to remove the different version installed. In the case of MRI 1.9.X+ a version of RubyGems comes built in. For example if we wish to install RubyGems version 1.5.2 we would do so as follows. In order to install a specific rubygems version you can specify the version directly. If a newer version of rubygems has been released than the one that RVM knows about then you should get the latest version of RVM, the latest git head would be best, in order to be able to install the newer version since their download url's change for each release / are not consistent (rubyforge scheme). In order to install the most recent RubyGems that RVM knows about you can do: ![]() RVM now provides a 'rubygems' CLI command which allows you to change the rubygems version for the installed interpreter. Then switching to individual RVM Ruby gem directories can be done as follows. If this is something you do frequently you can put the following bash function in your ~/.bash_profile or ~/.zshrc:Įcho "gemdir expects a parameter, which should be a valid RVM Ruby selector" To change to the currently selected Ruby's gem directory, use a subshell: You can see the gem directory of the currently selected ruby using the gemdir action: ![]() (You will start to think that someone has a voodoo doll of your application.) So to reiterate, as soon as you 'sudo' you are running as the root system user which will clear out your environment as well as any files it creates are not able to be modified by your user and will result in strange things happening. When you do sudo you are running commands as root, another user in another shell and hence all of the setup that RVM has done for you is ignored while the command runs under sudo (such things as GEM_HOME, etc.). In addition you can separate this further and have a set of gems per project/application/gerbil color. RVM creates a new completely separate gem directory for each version of ruby.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |