开发者

Rails 3 continues to use ruby 1.8.7 even though "ruby -v" states 1.9.2

开发者 https://www.devze.com 2023-04-11 11:43 出处:网络
I have finished developing my app and am currently deploying it. I\'m getting a weird error from one of my controllers:

I have finished developing my app and am currently deploying it. I'm getting a weird error from one of my controllers:

syntax error, unexpected ':', expecting ')'

When I run it in my dev environment it works fine. The only difference I can see between dev/prod is that dev is is using Ruby 1.9.2 and Prod is using 1.8.7. In my naivete I thought "Oh I'll just upgrade to 1.9.2" - what I fool I've been. I used RVM, changed my path, started new terminal session and now can see ruby is at 1.9.2:

ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

which ruby
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby

Howev开发者_如何学Cer, when I run a "rails s" my computer continues to use 1.8.7:

[2011-10-05 05:58:40] INFO  WEBrick 1.3.1 
[2011-10-05 05:58:40] INFO  ruby 1.8.7 (2010-08-16) [x86_64-linux] 
[2011-10-05 05:58:45] INFO  WEBrick::HTTPServer#start: pid=32574 port=3000

What the what!!!? I hope someone can help me. I'm about 15 minutes away from moving to the country, and become a farmer!

Thanks in advance.


if you used sudo when installed it might be the reason

sudo passenger-install-apache2-module

uses system ruby. Try

passenger-install-apache2-module

which should produce proper config files.


Have you tried rvm reload ? sometimes when I get strange errors like that reloading rvm fixes it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号