For reasons beyond my control, I need to run a Rails 4 app on CentOS 7. Currently, it is running successfully on a Red Hat with rvm and Passenger. I'd like to migrate it over to rbenv and Puma but I am stuck with this issue.
I am trying to run a test installation on a VirtualBox virtual machine. I believe I've wired everything together correctly. I have disabled SELinux. When I run cap deploy
, puma starts successfully:
04:03 puma:start
using conf file /var/www/rails-app/shared/puma.rb
01 bundle exec puma -C /var/www/rails-app/shared/puma.rb --daemon
01 * Pruning Bundler environment
01 [6464] Puma starting in cluster mode...
01 [6464] * Version 3.9.1 (ruby 2.1.10-p492), codename: Private Caller
01 [6464] * Min threads: 4, max threads: 16
01 [6464] * Environment: vm
01 [6464] * Process workers: 1
01 [6464] * Phased restart available
01 [6464] * Listening on unix:///var/www/rails-app/shared/tmp/sockets/puma.sock
01 [6464] * Daemonizing...
✔ 01 deploy@localhost 0.537s
But the Puma access log spins out this error in an infinite loop:
/home/deploy/.rbenv/versions/2.1.10/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
... stack trace clipped ...
Listing the processes associated with my Puma user shows:
$ ps aux | grep deploy
deploy 12645 0.0 0.2 115384 2084 pts/0 S 18:18 0:00 -bash
deploy 18517 0.7 1.7 271344 18076 ? Sl 18:27 0:00 puma 3.9.1 (unix:///var/www/rails-app/shared/tmp/sockets/puma.sock)
deploy 23279 7.0 0.0 0 0 ? Z 18:29 0:00 [ruby] <defunct>
deploy 23283 4.0 1.7 273400 17464 ? Rl 18:29 0:00 puma: cluster worker 0: 18517
I have confirmed that I can successfully run Bundler as the deploy
user that owns the Rails application and the Puma process:
cd /var/www/rails-app/current && bundler --version
Bundler version 1.15.4
So I am not sure why am I seeing this error. After hours of research and troubleshooting, I'm stuck. I can provide config files if needed but they're pretty standard and I think would only clutter up this question at this point.
Does this issue look familiar to anyone?