1
votes

I am trying to deploy a Rails app from a Windows development machine to a Debian 9 VPS using Capistrano, Passenger, and RVM. I got RVM and Passenger set up with Apache on the VPS and Capistrano set up on the Windows machine. However, when I try to run cap production deploy, I get the following error:

bundler: failed to load command: rake (/var/www/APPNAME/shared/bundle/ruby/2.4.0/bin/rake)

One quirk of developing on Windows is that the Gemfile.lock must be edited on deployment to remove Windows-specific versions of gems. I have written a custom task to perform this action, which seems to run as expected.

Here are some files that might be useful:

1
have you checked if /var/www/APPNAME/shared/bundle/ruby/2.4.0/bin/rake exists on the VPS? And is your capistrano ssh user in the rvm group? Does your capistrano setup source the rvm environment before trying to call ruby scripts?Camden Narzt
I checked and the file exists. There is no group called "rvm" on the VPS; rvm is installed into the ssh user's home directory. I am using the capistrano-rvm gem and the source command is in the ssh user's bashrc, so I think the environment is being loaded.user4592253
I'd suggest testing that assumption, rvm is very fragile.Camden Narzt

1 Answers

0
votes

The problem was resolved after I downgraded Bundler to version 1.12.5 (it was previously version 1.15.4). I assume there is some sort of conflict with my setup and newer versions of Bundler; but until the underlying issue is patched, I will continue using the older version.