简体   繁体   English

单独乘客使用错误的红宝石版本?

[英]Passenger stand alone uses wrong ruby version?

Hello im using rails 4 with rvm - ruby verison 2.0. 你好我使用rails 4与rvm - ruby​​ verison 2.0。 But when i try to start passenger (stand alone) im getting syntax-errors. 但是,当我尝试启动乘客(独立)时,我会遇到语法错误。

It tells me: 它告诉我:

Ruby interpreter command
/usr/bin/ruby1.8

How can i change it to the rvm 2.0 version? 如何将其更改为rvm 2.0版本?

you need to use ruby first: 你需要先使用ruby:

rvm use ruby

it might display additional instructions - make sure to read them 它可能会显示其他说明 - 请务必阅读它们

I had the same problem: passenger standalone uses nginx, and after upgrading my app to use ruby 2.1.1 (specified in the .ruby-version), I saw similar errors. 我有同样的问题:乘客独立使用nginx,并在升级我的应用程序以使用ruby 2.1.1(在.ruby-version中指定)后,我看到类似的错误。

On my production server, I know where the nginx configuration lives, so I could fix the path to the ruby interpreter. 在我的生产服务器上,我知道nginx配置在哪里,所以我可以修复ruby解释器的路径。

However on the standalone setup I couldn't find it in less a minute, so I did a gem uninstall passenger followed by gem install passenger to have it recompile nginx. 然而,在独立设置上我找不到它在一分钟内,所以我做了一个gem uninstall passenger跟随gem install passenger让它重新编译nginx。

Now it works, at least until the next ruby interpreter bump. 现在它起作用,至少直到下一个ruby解释器碰撞。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM