I've got Xcode 3.2.1
I've installed Git and RVM
I've installed Ruby 1.9.2, it's installed 100%
I run ruby -v but instead of seeing
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
I see
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
I don't see what I could be going wrong
Try
rvm 1.9.2
Or
rvm --default 1.9.2
It is possible to use a .rvmrc to do that for the directory you cd into as well.
Have you selected the version of ruby you want to use with rvm? As in this? Note the "rvm 1.9.2" line hidden away after the rvm and ruby installs.
Type in 'rvm 1.9.2' and then type 'ruby -v'... did you do that? It looks like the Ruby 1.8.7 on your machine is the one included with OS X.
Related
I have 2 version of Ruby on the system, but like to use version 1.8.6.
Could someone show me how to do this?
/usr/local/bin/ruby -v
ruby 1.8.6 (2009-08-04 patchlevel 383) [x86_64-linux]
/usr/local/rvm/rubies/ruby-2.1.2/bin/ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
which ruby
/usr/local/rvm/rubies/ruby-2.1.2/bin/ruby
Thanks,
PL
Solution:
I found solution at https://superuser.com/questions/137130/how-to-configure-installed-ruby-and-gems by adding 2 lines in ~/.gemrc file.
Thanks for all replies.
Set it in a .ruby-version file in your project directory. Something like:
1.8.6-p383
You can switch your version of ruby using rvm, assuming you installed that version with rvm, like this:
rvm use 1.8.6 --default
Or if you had ruby pre-installed and want to use that version than use this:
rvm use system --default
Of course, remove the --default if you don't want it to be the default.
Seeing that you didn't install 1.8.6 with rvm, I would reinstall it with rvm, so you are using rvm consistently across all your ruby versions.
You're not on the right forum, but the answer lies in the order of directories in your $PATH. Check your .profile and/or /etc/profile.
I installed ruby via
apt-get install ruby1.9.1 rubygems
However, when I run ruby --version I see
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Have I missed something? When I try to run a gem which requires 1.9+ it fails and asks me to upgrade.
The package ruby1.9.1 will give you an executable called ruby1.9.1, which you should use instead of ruby.
You can set ruby1.9.1 as default ruby version using following command
update-alternatives --set ruby /usr/bin/ruby1.9.1
You may find out about available alternatives using following
update-alternatives --query ruby
In this way you can set the default ruby version
$ rvm --default use 1.9.2
$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
On Mac OS X running Lion 10.7.3 and having Xcode 4.3.2, I find that installing ruby 1.9.3 through rvm and setting default to use 1.9.3 still shows ruby -v to be 1.8.7 (irb RUBY_VERSION also shows 1.8.7).
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
$ rvm install 1.9.3 --with-gcc=clang
<installs successfully>
$ rvm --default 1.9.3
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
$ irb
>> RUBY_VERSION
=> "1.8.7"
How do I get ruby and irb to use ruby 1.9.3 on this configuration?
Update: Looks like I had an older version of rvm. I installed Jewelry Box (OS X rvm GUI tool), which reinstalled rvm, and then updated the ruby to use from within jewelry box. This did the trick. Thanks all for your help.
Thanks
If you have successfully installed ruby 1.9.3
then you can check it by this command either installed or not
rvm list
then all rubies listing will be display...
then if you select any rubu version use this command
rvm use ruby-1.9.3 --default
and enjoying.........
rvm get head will update your RVM installation in place to the current release. It's a good idea to do that periodically, just to keep up with the bug fixes and new features.
I had a similar issue and wanted to post my solution as it may be helpful for someone. I switched to 1.9.3 in my terminal window and then opened another window to use IRB in that window. When I did
RUBY_VERSION
in IRB it told me I was using 1.8.7. I realized after that I shouldn't have opened another window to do it. It works just fine if I stay in the same window, make sure I am using 1.9.3 and then go into IRB from there.
Thought someone else might have a use case like mine and this would help.
I ran the command 'ruby -v' on my Linux Mint 10 virtual machine and got:
stapiagutierrez#Sergio-Linux-VM ~/Desktop/Tickets/tickets $ ruby -v
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]
How can I upgrade it to the latest version, 1.9.2?
I would suggest using RVM. That way you can keep the 1.8.7 version of Ruby, but you can also install new ones easily:
rvm install 1.9.2
And switch between them with no effort:
rvm 1.8.7
rvm 1.9.2
Using rvm you can set your default version of Ruby like this:
rvm --default use 1.9.2
I set the default ruby as,
rvm --default 1.9.2
when I do ruby -v, I get 'ruby 1.9.1'
when I do which ruby I get .rvm/rubies/1.9.2PathOfRuby
Any idea how to fix this?
When I run a sample program, printing the version of ruby i.e, print RUBY_VERSION it prints 1.9.1 :(
I'm using rvm along with a default ruby of 1.9.2 v0:
Greg:~ greg$ rvm list
rvm rubies
ruby-1.8.7-p302 [ i386 ]
=> ruby-1.9.2-p0 [ i386 ]
Greg:~ greg$ rvm -v
rvm 0.1.46 by Wayne E. Seguin (wayneeseguin#gmail.com) [http://rvm.beginrescueend.com/]
Greg:~ greg$ ruby --version
ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-darwin9.8.0]
Greg:~ greg$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-darwin9.8.0]
I'm not sure what the current version of rvm is, but 0.1.46 seems to be working correctly. You might want to try doing rvm update to get the latest rev if you're running an older version.
Your best solution for rvm help is to go directly to the author, Wayne Seguin, either on the RVM site or on #IRC at irc.freenode.net. The RVM site is http://rvm.beginrescueend.com/.
Wayne's a great guy, very helpful and quick to respond.
Check your PATH statement in .bash_profile (or equivalent). Remove entries that reference gems/ruby-1.9.1-yadda. Restart your terminal and check the version of ruby then. It should report 1.9.2 now, although you might need to rerun rvm 1.9.2 --default again.