Webrick starts with ruby 1.8.7 instead of 1.9.2

Hi
I have installed Ruby 1.9.2 and upgraded Rails to 3.0.4 (Mac OS X
10.6). Running “ruby -v” this is the output:
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0]

Running “which ruby”, the output is:
/usr/local/ruby1.9/bin/ruby

The problem is then I’m starting the WEBrick server with “rails
server”:
[2011-02-27 10:56:13] INFO WEBrick 1.3.1
[2011-02-27 10:56:13] INFO ruby 1.8.7 (2009-06-12) [universal-
darwin10.0]
[2011-02-27 10:56:13] INFO WEBrick::HTTPServer#start: pid=21069
port=3000

Why is Ruby 1.8.7 used, and what to do to have WEBrick using Ruby
1.9.2 instead?

Best regards,
Magnus

It appear that in your gem environment the it set to use 1.8.7

run gem environment to check on that

On Sun, Feb 27, 2011 at 1:09 PM, radhames brito [email protected]
wrote:

It appear that in your gem environment the it set to use 1.8.7

run gem environment to check on that

fixing typos, sorry

It appears that in your gem environment the interpreter is set to use
1.8.7

On Feb 27, 9:59am, Magnusvb [email protected] wrote:

[2011-02-27 10:56:13] INFO WEBrick 1.3.1
[2011-02-27 10:56:13] INFO ruby 1.8.7 (2009-06-12) [universal-
darwin10.0]
[2011-02-27 10:56:13] INFO WEBrick::HTTPServer#start: pid=21069
port=3000

Why is Ruby 1.8.7 used, and what to do to have WEBrick using Ruby
1.9.2 instead?

I’d guess that you have both ruby 1.8.6 and 1.9.2 installed, both are
on the path but you’ve only installed the rails gem for ruby 1.8.7, so
while ‘ruby’ finds 1.9.2, running ‘rails’ finds the one installed with
ruby 1.8.7. If you install rails in your ruby 1.9.2 environment you
should be ok.

Fred

Thanks all.
The output of gem env is:

RubyGems Environment:

  • RUBYGEMS VERSION: 1.5.3
  • RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [x86_64-
    darwin10.6.0]
  • INSTALLATION DIRECTORY: /usr/local/ruby1.9/lib/ruby/gems/1.9.1
  • RUBY EXECUTABLE: /usr/local/ruby1.9/bin/ruby
  • EXECUTABLE DIRECTORY: /usr/local/ruby1.9/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-darwin-10
  • GEM PATHS:
    • /usr/local/ruby1.9/lib/ruby/gems/1.9.1
    • /Users/magnus_vb/.gem/ruby/1.9.1
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

It looks for a newbie like me alright (except the “1.9.1”. Should it
not be 1.9.2 ?). So, I did a “gem install rails”. Then restarted
Terminal, did a “bundle update”. And… Yes! Now it is using Ruby
1.9.2 :=)

Many, many thanks
Magnus

On Feb 27, 6:22pm, Frederick C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs