我在 staging server 上rake db:create
结果:
rake aborted!
LoadError: cannot load such file -- phusion_passenger/rack_handler
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
/usr/local/rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
这是我的 Gemfile:
group :development, :test do
# https://github.com/deivid-rodriguez/byebug
gem 'byebug'
gem "capistrano", "~> 3.4"
gem "passenger", ">= 5.0.25", require: "phusion_passenger/rack_handler"
end
我只是在本地开发用 passenger 做 server 来着。虽然我服务器端也用的 passenger,但是应该和这个无关吧。 求大牛指点!
EDIT:1. staging server 是 staging 环境
2. 运行rake db:create
之前运行` bundle install --deployment --without development test`
解决办法:默认不加 Rails_env 就是对 develop 和 test 生成数据库,加上 staging 就可以了。