Search code examples
windowsruby-on-rails-3webrickpik

How to set webrick server to use ruby 1.9.3?


Can rails server be specified for the particular ruby version?

I'm on windows using gitbash and pik. I have ruby 192 and 193 installed via rubyinstaller. Pik is setup after much adding of .bashrc .pikrc and editing config.yml files. I can switch between rubies and gitbash sees the change. All appears to be well.

However, when running a simple test rails app, running rails server fails. Not an error but the welcome page is only plain text. The ruby is set to 193 but webrick reports 192 as noted on the second last line.

    laptop@LAPTOP-PC ~/Documents/Sites/rails_projects/demo_app (master)
    $ ruby -v
    ruby 1.9.3p0 (2011-10-30) [i386-mingw32]

    laptop@LAPTOP-PC ~/Documents/Sites/rails_projects/demo_app (master)
    $ rails server
    => Booting WEBrick
    => Rails 3.1.3 application starting in development on http://0.0.0.0:3000
    => Call with -d to detach
    => Ctrl-C to shutdown server
    [2011-12-07 19:08:18] INFO  WEBrick 1.3.1
    [2011-12-07 19:08:18] INFO  ruby 1.9.2 (2011-02-18) [i386-mingw32]
    [2011-12-07 19:08:19] INFO  WEBrick::HTTPServer#start: pid=1840 port=3000

How to set webrick to use 193? Any tips appreciated.


Solution

  • as noted above, all I had to do was run bundle install again, and now webbrick server uses ruby 193