2

I'm trying to bundle a rails app on an Ubuntu staging server, so that I can more or less just copy the whole thing to the production server.

Reason: I do not have privileges to install gems on production, being a managed server.

So, I ran bundle install on the staging server followed by scp -rC vendor/bundle user@production:~/app_dir/vendor/

Issues:

  1. I'm not seeing the website after restarting the production webserver (apache/passenger) - instead I get "403 - You don't have permission to access / on this server.".
  2. If I run for example rails c or rake assets:precompile I get "Could not find rake-10.4.2 in any of the sources" even though rake-10.4.2 exists in the vendor/bundle/ruby/2.0/gems folder

Is my approach of bundling and copying a sound one?

How do I make the rails app on production work with the gems from the vendor-folder?

henrik242
  • 366
  • 4
  • 11
  • Use `bundle install --path=vendor/bundle` on the production server to install gems "locally". – user229044 Apr 21 '15 at 12:44
  • @meagar Can it be done somehow for gems with native extensions if no toolchains are installed on production? – mlt Jan 24 '21 at 10:32

0 Answers0