Sounds strange but I cannot tell which ruby version is installed. If I do
rvm rubies
I get
ruby-1.9.2-p180 [ i686 ]
but with
ruby -v
I get
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
When trying to
rvm upgrade 1.8.7-p302 1.9.2-p180
I get an error
ERROR: Ruby 'ruby-1.8.7-p302' is not installed - please install it first.
ERROR: Error migrating gems.
So, which one is it? 1.8.7-p302 or 1.9.2-p180 ???
Please help me out here! Thanks
You get 1.8.7 from the installed version of your system. Use rvm use --default 1.9.2 in order to set the Ruby installed via rvm as default.
RVM basically changes your $PATH variable to point to a different Ruby version than the one installed on your system.
Please also make sure that you have done steps 2 and 3 of the installation guide and confirmed that RVM is correctly set up.
You might have 1.8.7 because you did sudo apt-get install ruby or something like that, and then later ran rvm install 1.9.2. Is that the case?
The answer is both as mentioned by other posters. As a recommendation you should uninstall the ruby packages that come with the system if you choose to manage ruby version using rvm.
Related
This problem probably has an obvious answer to anyone who has used Ruby on linux for a long time, but I can't really get a good answer via Google.
I'm trying to check out the Rails 5 beta, which requires Ruby 2.2.2 or greater. I've installed the RVM (Ruby Version Manager) and set my ruby version to 2.2.3. Running rvm list in the terminal results in the following output:
rvm rubies
=* ruby-2.2.3 [ x86_64 ]
# => - current
# =* - current && default
# * - default
Okay, great. I have Ruby 2.2.3 installed. Let's try bundle update:
Installing rack 2.0.0.alpha (was 1.6.4)
Gem::InstallError: rack requires Ruby version >= 2.2.2.
Okay, that's weird. What version of ruby do I have? Running ruby -v gives me this:
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
So... do I have 2.2.3 or not? What gives?
Since you are using bundle, I would suggest you to check your Gemfile for ruby version. You can also test it with bundle exec ruby -v
Also try:
rvm use ruby-2.2.3
bundle exec ruby -v
Maybe by setting the default Ruby version on rvm to the one you have (ruby-2.2.3) solves the problem, by doing rvm --default use ruby-2.2.3. Then reload the bash and execute ruby -v to check if the default version of Ruby was changed properly and then try again to execute the bundle install command.
If you don't know zsh and oh-my-zsh, I highly recommend for this kind of things. You could configure the terminal in order to show you the current version of Ruby and Rails that you're using every moment. Check it here: http://ohmyz.sh/
In addition to doing rvm use --default 2.2.3 or rvm use 2.2.3 make sure that you don't have the ruby package from apt (or whatever package manager) still installed. For some reason, that ruby package could take precedence over an RVM Ruby.
Also, try doing rvm uninstall 2.1.5 to force your system to default to 2.2.3... You can always reinstall 2.1.5 later and, if this issue persists, 2.2.3 should stick as your default.
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.
Well, when I run rvm install 1.9.2. It tells me to issue rvm reinstall 1.9.2. Though, when I do so, I get 1.8.7 reinstalled. 1.8.7 is the only interpreter listed by rvm list.
The O.S. is Ubuntu without rvm-ruby installed. Rvm is at its latest version.
Any suggestion on how to fix this?
I fixed this by removing the .rvmrc file from my home directory and then issuing rvm install 1.9.2.
I have the following problem and whatever I try, nothing helps. I hope someone could help me with this.
I have a redhat server and I'm trying to install redmine on it. Redmine needs Ruby >= 1.8.7 to run so I installed it and when I execute ruby -v in the console it says I have version 1.8.7 (so that's great)
[root#vms redmine]# ruby -v
ruby 1.8.7 (2008-05-31 patchlevel 0) [x86_64-linux]
But when i try to install the passenger gem I need to run redmine on Apache it says I don't have ruby 1.8.7
[root#vms redmine]# gem install passenger
ERROR: Error installing passenger:
rake requires Ruby version >= 1.8.6
Does anyone know how this can be fixed?
You need newer ruby, you have patchlevel 0, try to get patchlevel 173 at least.
RVM can help you.
Using vendor build ruby packages is an exercise in frustration.
For anything with ruby it's easier just to use RVM and build a virtual environment. You can then build exactly what you need and have an environment you can replicate reliably. Also you won't end up clobbering your vendor's Ruby install.
My current version is ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10]
Step 1. Install Homebrew: https://github.com/mxcl/homebrew
This enables you to install various *IX projects on a mac. You may need to install xcode as part of this, so you may need your OS X disc to hand. Homebrew is useful for many other things - a good thing to have installed anyway.
Step 2. Install Ruby Version Manager:
brew install rvm
Step 3. Install whichever Ruby version you want. This means you can have multiple Ruby installations (with their own sets of rubygems) running independently of one another. for 1.9.2 try this:
rvm install 1.9.2
If you get a 'readline' error, try this:
rvm package install readline
rvm remove 1.9.2
rvm install 1.9.2 --with-readline-dir=$rvm_path/usr
You should now be able to do this to test your ruby version:
ruby --version
To switch back to another version of ruby, just use the rvm command.
You can try rvm to install whatever the version of ruby.
if you will get error
undefined method `path' for Gem:Module (NoMethodError)
during command
~/rubygems-1.3.7 $ ruby setup.rb
remove ruby and rubygems with command
sudo autoremove ruby
sudo autoremove rubygem
ant try to install all again