Dave Dave - 2 years ago 94
Ruby Question

Ruby Version Discrepancy when running server

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.3.0]
$ rails s
=> Booting WEBrick
=> Rails 3.0.0 application starting in development on
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-09-28 13:45:50] INFO WEBrick 1.3.1
[2010-09-28 13:45:50] INFO ruby 1.8.7 (2009-06-08) [universal-darwin10.0]
[2010-09-28 13:45:50] INFO WEBrick::HTTPServer#start: pid=20761 port=3000

When I check my version number, it looks like I'm running 1.9.2p0

But when I run the server, it shows that I'm running 1.8.7... Any ideas as to how I fix this?

Answer Source

You have two Ruby binaries. As well as two gem scripts and gem repos in your hdd. To find all the stuff you need - use the which command:

$ which -a ruby
$ which -a gem

Then just nuke the one you don't need and start using rvm.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download