nginx无法加载此类文件 - ruby​​gems / path_support

时间:2013-03-18 15:58:05

标签: ruby-on-rails-3 nginx

我在nginx + passenger + rails 3.2.1之下,当我尝试启动我的应用时,我得到了

cannot load such file -- rubygems/path_support

宝石环境的输出是

RubyGems Environment:


- RUBYGEMS VERSION: 1.8.23
  - RUBY VERSION: 1.9.3 (2012-11-10 patchlevel 327) [i686-linux]
  - INSTALLATION DIRECTORY: /root/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /root/.rbenv/versions/1.9.3-p327/bin/ruby
  - EXECUTABLE DIRECTORY: /root/.rbenv/versions/1.9.3-p327/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /root/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1
     - /root/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

在我的nginx.conf中我有

user root;

http {
      passenger_root /root/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/passenger-3.0.19;
      passenger_ruby /root/.rbenv/versions/1.9.3-p327/bin/ruby;
    passenger_default_user root;
    passenger_default_group root;
....

我还能检查什么? 谢谢

1 个答案:

答案 0 :(得分:0)

非常感谢!配置文件中的代码挽救了我的生命:

passenger_default_user root;
passenger_default_group root;

我遇到了与您相同的错误,并使用您的配置文件解决了,详细解答如下:https://stackoverflow.com/a/15777738/445908