在ubuntu 14.04上使用passenger-install-nginx-module的Bundler错误

时间:2016-09-16 10:13:46

标签: ruby-on-rails ruby ubuntu nginx passenger

我正在ubuntu 14.04安装乘客+ nginx& ruby 2.2.4bundler

出现passenger-install-nginx-module次错误
  $passenger-install-nginx-module
    /home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in `full_gem_path': uninitialized constant Bundler::Plugin::API::Source (NameError)
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:144:in `block in full_require_paths'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `map'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `full_require_paths'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:76:in `contains_requirable_file?'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `block in find_in_unresolved'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `each'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `find_all'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:949:in `find_in_unresolved'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:74:in `require'
            from /home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/plugin/api/source.rb:2:in `<top (required)>'
            from /home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in `full_gem_path'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:144:in `block in full_require_paths'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `map'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/basic_specification.rb:143:in `full_require_paths'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1370:in `add_self_to_load_path'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1283:in `activate'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:67:in `block in gem'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `synchronize'
            from /home/ubuntu/.rvm/rubies/ruby-2.2.4/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `gem'
            from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/passenger-install-nginx-module:22:in `<main>'
            from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/ruby_executable_hooks:15:in `eval'
            from /home/ubuntu/.rvm/gems/ruby-2.2.4/bin/ruby_executable_hooks:15:in `<main>'

在此之前,已安装gem passenger (v5.0.30)rails 4.2.0。是什么导致错误?

2 个答案:

答案 0 :(得分:9)

有同样的问题,

我做了什么:

gem uninstall bundler -v1.13.1

(或gem uninstall bundler -v1.13

然后

gem install bundler -v 1.12

然后passenger-install-apache2-module有效。

这里的建议:

答案 1 :(得分:5)

检查您是否拥有正确版本的RubyGems

$ gem -v

2.6.5(或更高级)

如果还没有,请升级RubyGems:

$ gem update --system

如果你不能像这样使用sudo

$ sudo gem update --system

现在检查你有最后一个捆绑版本:

$ bundle -v

Bundler版本1.13.0(或更高级)

如果还没有,请升级您的Bundler:

$ gem install bundler