Why is “rails runner -e production” not working?

孤人 提交于 2019-12-23 20:23:38

问题


To solve my problem, which is discussed in "will_paginate error in production undefined method 'paginate'", I tried running:

script/rails runner -e production

and:

bundle exec script/rails runner -e production

on the server like suggested in this github issue: https://github.com/mislav/will_paginate/issues/308#issuecomment-17167158

But I get the following error:

bundler: command not found: script/rails
Install missing gem executables with `bundle install`

Bundle install doesn't help. Any suggestions?

I'm using: Ruby 2.0.0p247, Rails 4.0.0, Ubuntu 12.10 LTS, Unicorn, Capistrano


回答1:


Try this instead:

bundle exec rails runner -e production.




回答2:


Use bin/rails runner for rails4 (when the bin/rails file exists)



来源:https://stackoverflow.com/questions/19683405/why-is-rails-runner-e-production-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!