Rails console not working on server

前端 未结 5 1095
灰色年华
灰色年华 2020-12-29 23:51

When I run bundle exec rails console production or rails console production via SSH on the server in the Current folder of the Capistr

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 00:46

    I am using capistrano to deploy, including the capistrano/bundler gem. Since the ./bin directory is version controlled in Rails 4, we need to prevent Capistrano from linking it on deployments by removing bin from set :linked_dirs.

    Now in order to prevent bundler from overwriting the version controlled binstubs, we can add the line set :bundle_binstubs, nil which will prevent capistrano-bundler from setting the --binstubs option when running bundle install.

    My config/deploy.rb file now has these lines:

    # Default value for linked_dirs is []
    set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
    
    set :bundle_binstubs, nil
    

    Note the lack of the bin directory in the :linked_dirs line.

提交回复
热议问题