Rails 5 console not working when deploying with Ca

2019-02-14 16:36发布

I amm using Rails 5, and I have half way deployed my app through Capistrano on server. due to specific need to loadschema, i ssh in and cd into the release/### directory and tried to run

rails --version # came out 5.0.3beta

bundle # works, everything installed

rails c # but this fail

running rails db:migrate also failed.

it seems to return rails generic help as like my directory isn't a rails directory.

i tried deleting bin folder, but still the same. anyone know what could be wrong?

enter image description here

thank you

2条回答
放荡不羁爱自由
2楼-- · 2019-02-14 17:09

It seems you're using capistrano to deploy your application. Have a look at this issue: https://github.com/capistrano/bundler/issues/45

The solution would be:

  1. remove bin from the linked_dirs
  2. add set :bundle_binstubs, nil to your config/deploy.rb to generate the binstubs
查看更多
仙女界的扛把子
3楼-- · 2019-02-14 17:09

To run the console try rails console. To run a migration try rake db:migrate

查看更多
登录 后发表回答