chef-repo
chef-repo copied to clipboard
recent issues with vendor/bundle gems
Hi,
Great work on the repo. I am using a slightly modified version where I use puma instead of unicorn, but I believe the issue I am going to describe is somehow related to bundler (I'm not sure though). I wasn't sure where to get help so I'll start here, perhaps some of you had a similar problem or can provide insight.
Recently, I set up a new server with my Chef script, the same as I've been using for the previous servers. For some reason 2 things stopped working:
- ruby cronjobs
- puma script which uses prune_bundler (reloads Gemfile in master process on hot restart, I only have problems when this is turned on, but it worked fine on old server)
It seems rbenv/bundler is not loading my gems anymore from vendor/bundle
.
For now to fix it, I had to do the following:
- to make cronjobs work, I had to create a file
~/.bundle/config
and put this in it:
---
BUNDLE_PATH: vendor/bundle
It seems for some reason before adding this, it was ignoring the app/current/.bundle/config file. My cronjobs look like this:
0 * * * * /bin/bash -l -c 'source /etc/profile.d/rbenv.sh; cd /u/apps/myapp/current && RAILS_ENV=production bundle exec rake something'
- to make puma work, I had to add
export GEM_HOME="$app/vendor/bundle/ruby/2.1.0"
to my script
Note I don't have any of this on my old server and it works just fine.
Any idea what happened? I can see that rbenv version was updated from 0.4.0-143-g4d72eef
to 0.4.0-146-g7ad01b2
on the new server, but I looked at the rbenv commits and it doesn't seem like anything was changed that could cause this. Bundler version changed from 1.7.9
to 1.9.1
.
It seems like the problem could be due to bundler. With the above changes I can at least run things for now, but I want to understand what happened and especially get rid of the GEM_HOME hack.
Last time I merged your latest changes into my repo was on December 23 (ad74120774fef61682a44002550c5d12e4e5b658).
Any help is appreciated!