I am trying to setup Ruby 1.9.2-p180 on my system for project specific purposes. I already have Ruby 1.9.2-p134 and Ruby 1.8.7 with me.
Do I need to replace Ruby 1.9.2-p134 with Ruby 1.9.2-p180 or can both co exist?
I'm making use of Ubuntu 10.04 OS.
Thank you..
That's exactly what RVM is for.
rvm install 1.9.2-p180
Then to use it…
rvm use 1.9.2-p180
You can also use .rvmrc to configure projects per-directory and set the rvm default to whichever you prefer.
To list installed Ruby versions…
rvm list
:)
Related
I understand that rvm allows us to run multiple versions of ruby. Are ruby gems installed to a specific version of ruby? Say I upgraded to the latest version of ruby 2.1.1 and want to use that as my default, do I have to reinstall the ruby gems from the earlier version of ruby to this version?
If you use rvm install, you will have to install your gems anew. If you use rvm upgrade, the gems will be migrated if possible.
Check out the RVM documentation:
RVM creates a new completely separate gem directory for each version of ruby. In addition you can separate this further and have a set of gems per project/application/gerbil color... see the gemsets for more details on using sets of gems. [...]
rvm --default use <RUBYVERSION>
For example,
rvm --default use 2.1.1
You can check this. And check out RVM Documentation too.
I have to upgrade from ruby 1.8.7 to ruby 1.9.3; I'm trying to install refinery cms and it uses truncate_html gem, which depends on ruby (>= 1.9). I've installed ruby 1.9.3-p374 without removing ruby 1.8.7.
I've used the command rvm --default use 1.9.3 and it issued the result
Using /usr/share/ruby-rvm/gems/ruby-1.9.3-p374
but when i type ruby -v it was again 1.8.7.
How can I upgrade to ruby 1.9.3?
You are using RVM Ubuntu package which is broken, use this instructions to update https://stackoverflow.com/a/9056395/497756
Are you using a .rvmrc file for your project? If so, it might be selecting a specific Ruby over your default.
Open ./.rvmrc if it exists and remove (as necessary) any rvm use... references.
Try
ruby1.9.1 <filename.rb>
Actually, I have to work on Chef which use system default ruby v 1.8.7.
and with rvm installed ruby my Chef is not wroking.
So , To make my chef server installation. I required to have ruby1.8.7 into my system.Before I was using ruby 1.9.3 for my project(via RVM).
Can anybuddy tell , How can I install Ruby v1.8.7 in System(not in rvm) after installing ruby in RVM 1.9.3 .
Or is it possible or not?
you want to set a default ruby:
rvm use 1.8.7 --install --default
This will install ruby 1.8.7 if not installed, it will use it and set as default, so any time rvm is loaded - you will have access to it.
it is possible but to be honest you are better with RVM, in this way you can have control over your machine
rvm use system tells rvm to leverage a system install of Ruby. To set system Ruby as default, type rvm reset.
Use the package manager of your distribution, that's what rvm system is about - giving control back to your system.
I've been using the default system ruby version 1.8.7 without RVM for a few rails projects and have not run into any problems. I just recently installed RVM, and after running rvm requirements I get this output:
To use an RVM installed Ruby as default, instead of the system ruby:
rvm install 1.8.7 # installs patch 357: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.8.7
I believe what these commands do are to install the same gems that have already been installed using the system ruby under the RVM installed ruby.
My questions are, am I right in what these commands do? and if I am right, why is it important to do this, because if I wanted to use an RVM installed Ruby of a different version like 1.9.2, wouldn't it already separate gems in that version from the system's ruby?
The one thing that springs to mind is, if you use the system Ruby, you'll use it slightly differently that RVM's Rubies--for example, you'll likely need to use sudo to install gems. Furthermore, you won't be able to use many of RVM's features, like gemsets, with the system Ruby.
Well one reason I can think of is that you don't wanna worry about your system not working even if the system ruby gets updated.
My questions are, am I right in what these commands do?
You are right in what they do. The first command installs Ruby 1.8.7, the second command installs all the gems currently install on your system Ruby installation in the new RVM Ruby 1.8.7 installation, and the third command sets your default version of Ruby to be the RVM Ruby 1.8.7.
and if I am right, why is it important to do this, because if I wanted to use an RVM installed Ruby of a different version like 1.9.2, wouldn't it already separate gems in that version from the system's ruby?
The second command is actually more of about convenience than necessity. Yes, the gems install in the RVM 1.8.7 will be completely separate from the ones installed in the system version of Ruby; however, if you didn't run the second command, you're RVM 1.8.7 would start out with almost no gems (only the defaults). That means that you would need to go through and manually install the gems that you need to get your project up and running. Instead of doing that, the second command allows you to just install the same gems you've already installed in the system version of Ruby to the RVM 1.8.7 version—it doesn't migrate them, it just makes a copy of them. After the second command, there are two distinct sets of the exact same gems: one in the system Ruby and one in the RVM 1.8.7 Ruby. So, if you were to update gems in either of the Rubies, they would get updated, but the other version's gems would be unaffected.
Hope this helps answer your question.
I'm working on a project that i have to use ruby 1.8.7. I'm using today, ruby 1.8.6 + Mac OSX Darwin. This ruby 1.8.6 was installed with the OS, it's a developer package from Apple. My question is: how can i update this package? if i run ports, it dont find my current installed package and install a new ruby version, with different paths and as effect it breaks my rubygems (i know how to fix it, but it is always workarounds over workarounds).
There is a clean way to update the default ruby that comes with the OS or its better to remove it and just manage it by Port? Please answer like this one How to update to Ruby 1.8.7 don't helps me
Have you tried rvm gem? It manages Ruby versions installed, allow to compile most (if not all) actual (and archival) Ruby versions, sets proper environment variables pointing to actually used ruby version.
$ gem install rvm
$ rvm install 1.8.7
$ rvm use 1.8.7 --default
On my OS X machines I have several versions of Ruby installed.
I install then, from source, under /usr/local/ruby-1.X.X
Once you have multiple versions of Ruby installed you will need your environment to know which one to use.
I do this by setting the PATH, like so
export PATH="/usr/local/ruby-1.8.7/bin:$PATH";
See Hive Logic's article on installing Ruby