2

I am using Capistrano 3 to deploy a rails app, and I have run into a problem when trying to access the rails console on my VPS. When I run:

rails console production

I get an error that require relative can't load the file config/boot.rb. The problem seems to be stemming from the fact that the app is using the rails executable in shared/bin whereas all of my app logic is in current/bin. The problem is that the shared/config directory does not contain a boot.rb file. If I run:

bundle install --production

then everything seems to work. Should I just remove capistrano/bundler from my cap file and have the capistrano script just run bundle install --production, or am I getting other benefits from capistrano/bundler?

zishe
  • 10,665
  • 12
  • 64
  • 103
kempchee
  • 470
  • 1
  • 4
  • 17

2 Answers2

2

Rails console script use files in folder bin. So your bin folder must be in root folder of project (it already in your repositories), not in shared folder with symlinks.

Problem in default capistrano config deploy.rb:

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

So capistrano delete existed folders before create symlinks.

INFO [b72e6ca9] Running /usr/bin/env rm -rf /MyProject/releases/20150409074324/bin

INFO [f1ba66e7] Running /usr/bin/env ln -s /MyProject/shared/bin /MyProject/releases/20150409074324/bin

Remove bin from linked_dirs will fix that.

0

I believe you don't need the bundle install --production you can only write bundle install And to the console in the production mode you can write RAILS_ENV=production rails c

Sabyasachi Ghosh
  • 2,765
  • 22
  • 33