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>
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.
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.
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.
On my Ubunto 8.04 (Hardy) server, I'm trying to upgrade rubygems. When I try to update, it tells me I need Ruby >= 1.8.7, when I run ruby -v to check the version I have it tells me I have 1.8.7
$gem update --system
rubygems-update requires Ruby version >= 1.8.7
$ruby -v
ruby 1.8.7 (2008-06-20 patchlevel 22) [x86_64-linux]
I just upgraded ruby from source. I also have RVM installed but I'm not using it. How can I make rubygems use the proper version of ruby?
That's a very old version of Ruby 1.8.7 - I guess that it might be from a distribution package. Current versions of RubyGems should probably be matched with the latest patch level of Ruby.
I think that the simplest thing to do is to choose one way of managing your Ruby installation and remove any other Ruby stuff that was put on the system by other methods. RVM is probably the best approach ATM.
I just upgraded to rails 3 but was running ruby 1.9.1 prior to the upgrade. Rails 3 doesn't support Ruby 1.9.1. How can I downgrade to ruby 1.8.7?
This will downgrade from your current version to 1.8.7:
gem update --system 1.8.7
install rvm, this will allow you to run multiple versions of ruby and switch between them at will: rvm
As others have mentioned, its hard to come up with exact solution, in general to downgrade or switch versions for a user:
Install Ruby 1.8.7 (or locate it on your system if you have it already)
Edit your .bash_profile or .bashrc file to update your $PATH so that the 1.8.7 executable is found first. Something like this:
export RUBY_187_HOME='/path/to/1.8.7'
export PATH=$RUBY_187_HOME/bin:$PATH
This is a little similar to what RVM does and it works.
To test, try
$ which ruby
$ /path/to/1.8.7/bin/ruby