迁移到 rbenv 会破坏乘客 (nginx)

发布于 2024-12-11 14:40:07 字数 1283 浏览 6 评论 0原文

我在生产服务器上从 RVM 迁移到 rbenv。我使用“rvm implode”卸载了 rvm 并安装了 rbenv、ruby 1.9.2、rails、passenger 和 nginx-module。 除了按如下方式更改乘客根之外,我没有修改原始的 nginx.conf:

1st Try:
passenger_root /root/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/passenger-3.0.9;
passenger_ruby /root/.rbenv/versions/1.9.2-p290/bin/ruby;
2nd Try:
passenger_root /root/.rbenv/shims/passenger;
passenger_ruby /root/.rbenv/shims/ruby;

现在,当我尝试运行我的应用程序时,我在 error.log 中看到以下错误:

[error] 1291#0: *105 open() "/home/passenger/grabber/current/public/view" failed (2: No such file or directory)

这清楚地表明乘客尚未启动,并且我的 Rails 应用程序未启动认可。当我尝试手动启动 Passenger 时,出现以下错误:

   [ pid=17605 thr=70022120 file=utils.rb:176 time=2011-10-23 23:40:41.917 ]: *** Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (libruby.so.1.9: cannot open shared object file: No such file or directory - /home/passenger/grabber/shared/bundle/ruby/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/nokogiri.so) (process 17605, thread #<Thread:0x858e7d0>):
from /home/passenger/grabber/shared/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'

我已经安装了 nokogiri 好几次,并且可以在 gem 列表中看到 nokogiri。我不知道为什么搬到 rbenv 会破坏我的乘客。

I moved from RVM to rbenv on my production server. I uninstalled rvm using "rvm implode" and installed rbenv, ruby 1.9.2 , rails, passenger and nginx-module.
I have not modified my originlal nginx.conf apart from changing the passenger_root as follows:

1st Try:
passenger_root /root/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/passenger-3.0.9;
passenger_ruby /root/.rbenv/versions/1.9.2-p290/bin/ruby;
2nd Try:
passenger_root /root/.rbenv/shims/passenger;
passenger_ruby /root/.rbenv/shims/ruby;

Now, when I try to run my application I see the following error in error.log:

[error] 1291#0: *105 open() "/home/passenger/grabber/current/public/view" failed (2: No such file or directory)

This clearly indicates that passenger has not launched and my rails app is not recognized. When I try to manually start passenger, I get the following error:

   [ pid=17605 thr=70022120 file=utils.rb:176 time=2011-10-23 23:40:41.917 ]: *** Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (libruby.so.1.9: cannot open shared object file: No such file or directory - /home/passenger/grabber/shared/bundle/ruby/1.9.1/gems/nokogiri-1.5.0/lib/nokogiri/nokogiri.so) (process 17605, thread #<Thread:0x858e7d0>):
from /home/passenger/grabber/shared/bundle/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require'

I have installed nokogiri several times and I can see nokogiri in my gem list. I am not sure why moving to to rbenv has broken passenger for me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧梦荧光笔 2024-12-18 14:40:07

可以使用 rbenv、nginx 和乘客。有些已经进行了系统范围的安装。 http://blakewilliams.me/blog/4-system-wide-rbenv-install

我目前正在我的开发环境上进行测试,因此,假设您已经安装了 rbenv 并且在 .bashrc 中具有正确的 rbenv init:

gem install passenger
rbenv rehash
sudo bash -c "source ~/.bashrc && passenger-install-nginx-module"

您必须gem install guest得到垫片。执行bundle install来安装乘客不会给你这些。

最后:

passenger-config --root

将为您提供您的 passenger_root 路径和:

rbenv which ruby

您的 passenger_ruby 路径。

Passenger shim 指向可执行文件,但 passenger_root 必须是文件夹的路径。我尝试过使用红宝石垫片,但它不起作用。我还没有深究原因。

顺便说一句,我的 Gemfile 中确实有 nokogiri gem。哦,如果您有 .rvmrc 和/或 config/setup_load_paths.rb ,那么将它们作为乘客自动加载捆绑器删除应该是安全的。

我仍然需要对此进行更多测试,但到目前为止一切顺利。

It is possible to use rbenv, nginx and passenger. Some have gone for a system-wide install. http://blakewilliams.me/blog/4-system-wide-rbenv-install

I'm currently testing on my development environment so, assuming you have installed rbenv and have the correct rbenv init in your .bashrc:

gem install passenger
rbenv rehash
sudo bash -c "source ~/.bashrc && passenger-install-nginx-module"

You must gem install passenger to get the shims. Doing bundle install to install passenger won't give you these.

Finally:

passenger-config --root

will give you your passenger_root path and:

rbenv which ruby

your passenger_ruby path.

The passenger shim points to the executable but passenger_root must be a path to the folder. I've tried using the ruby shim but it doesn't work. I've not dug into why yet.

BTW, I do have the nokogiri gem in my Gemfile. Oh, also if you have .rvmrc and/or config/setup_load_paths.rb it should be safe to remove these as passenger autoloads bundler.

I still need to do a bit more testing on this but so far so good.

万人眼中万个我 2024-12-18 14:40:07

乘客和 rbenv 之间似乎不兼容(在搬起石头砸自己的脚之前确保你知道这一点) - 所以我删除了 rbenv 并搬回了 RVM...

There seems to be no compatibility between passenger and rbenv (make sure you know this before you shoot yourself in the foot) - so I removed rbenv and moved back to RVM...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文