Search code examples
ruby-on-railscapistranoruby-on-rails-5

Rails 5 console not working when deploying with Capistrano


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


Solution

  • 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