部署 passenger 问题

baypm2014 · 2016年03月17日 · 最后由 sharefun 回复于 2016年05月20日 · 3203 次阅读

环境相关: ruby 2.3.0 所有安装按照https://ruby-china.org/wiki/install_ruby_guide里的方式进行。

然后安装 passenger: gem install passenger

passenger -v Phusion Passenger 5.0.26

但 git clone 项目,bundle install 后,在项目的目录下 passenger 居然找不到:

alex@alex-VirtualBox:~/chen/work/ttt$ cd obms
alex@alex-VirtualBox:~/chen/work/ttt/obms$ passenger -v
/home/alex/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<Gem::Specification:0x48499e2 passenger-5.0.26> (NoMethodError)
    from /home/alex/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
    from /home/alex/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
    from /home/alex/.rvm/gems/ruby-2.3.0/gems/passenger-5.0.26/bin/passenger:33:in `<top (required)>'
    from /home/alex/.rvm/gems/ruby-2.3.0/bin/passenger:23:in `load'
    from /home/alex/.rvm/gems/ruby-2.3.0/bin/passenger:23:in `<main>'
    from /home/alex/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
    from /home/alex/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'

但在上层路径居然可以:

alex@alex-VirtualBox:~/chen/work/ttt/obms$ cd ..
alex@alex-VirtualBox:~/chen/work/ttt$ passenger -v
Phusion Passenger 5.0.26

请问各位有遇到过类似问题吗?

直接在 Gemfile 加入 gem 'passenger' 就可以了。 但不明白为什么不通过 bundler 管理,单独安装就会找不到,而且我确定 ruby 版本都对。

$ which passenger

#2 楼 @huacnlee 通过 which 查看是一样的:

alex@alex-VirtualBox:~/chen/work/ttt/obms$ passenger -v
/home/alex/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<Gem::Specification:0x4baa294 passenger-5.0.26> (NoMethodError)
    from /home/alex/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
    from /home/alex/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
    from /home/alex/.rvm/gems/ruby-2.3.0/gems/passenger-5.0.26/bin/passenger:33:in `<top (required)>'
    from /home/alex/.rvm/gems/ruby-2.3.0/bin/passenger:23:in `load'
    from /home/alex/.rvm/gems/ruby-2.3.0/bin/passenger:23:in `<main>'
    from /home/alex/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
    from /home/alex/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
alex@alex-VirtualBox:~/chen/work/ttt/obms$ which passenger
/home/alex/.rvm/gems/ruby-2.3.0/bin/passenger
alex@alex-VirtualBox:~/chen/work/ttt/obms$ cd ..
alex@alex-VirtualBox:~/chen/work/ttt$ which passenger
/home/alex/.rvm/gems/ruby-2.3.0/bin/passenger
alex@alex-VirtualBox:~/chen/work/ttt$ passenger -v
Phusion Passenger 5.0.26
需要 登录 后方可回复, 如果你还没有账号请 注册新账号