问题
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