Onur Kucukkece
Onur Kucukkece

Reputation: 1748

Capistrano deploy fails due to ruby messages

I'm trying to deploy my app using capistrano 3.4.0 & capistrano-rails 1.1.6 but it seems that during the assets manifest, when the command to copy .sprockets-manifest.json runs, somehow ruby messages mixing with commandos and causing the deploy fail.

This was happening before and I could fix it by downgrading sprockets gem to version 2.8 however in this I'm using rails 4.2.4 and it needs an sprockets version at least 3.

Below is the command and the output, I'd be glad if you could help me on this.

Thanks in advance

INFO [19795580] Running /usr/bin/env cp RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,  you can ignore these warnings with 'rvm rvmrc warning ignore /var/www/apps/meetings/releases/20160216200613/Gemfile'.  To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.    /var/www/apps/meetings/releases/20160216200613/public/assets/.sprockets-manifest-5435a7146eb18edb8a835b87bffff57b.json /var/www/apps/meetings/releases/20160216200613/assets_manifest_backup as user@server
DEBUG [19795580] Command: cd /var/www/apps/meetings/releases/20160216200613 && /usr/bin/env cp RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,  you can ignore these warnings with 'rvm rvmrc warning ignore /var/www/apps/meetings/releases/20160216200613/Gemfile'.  To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.    /var/www/apps/meetings/releases/20160216200613/public/assets/.sprockets-manifest-5435a7146eb18edb8a835b87bffff57b.json /var/www/apps/meetings/releases/20160216200613/assets_manifest_backup
DEBUG [19795580]    RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /var/www/apps/meetings/releases/20160216200613/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.

DEBUG [19795580]    cp: cannot stat ‘RVM’: No such file or directory
cp: cannot stat ‘used’: No such file or directory
cp: cannot stat ‘your’: No such file or directory
cp: cannot stat ‘for’: No such file or directory
cp: cannot stat ‘selecting’: No such file or directory
cp: cannot stat ‘Ruby,’: No such file or directory
cp: cannot stat ‘it’: No such file or directory
cp: cannot stat ‘is’: No such file or directory
cp: cannot stat ‘all’: No such file or directory
cp: cannot stat ‘fine’: No such file or directory
cp: cannot stat ‘-’: No such file or directory
cp: cannot stat ‘Heroku’: No such file or directory
cp: cannot stat ‘does’: No such file or directory
cp: cannot stat ‘that’: No such file or directory
...
...

Upvotes: 1

Views: 442

Answers (2)

Onur Kucukkece
Onur Kucukkece

Reputation: 1748

OK. The problem was caused because rvm is overriding the cd command in order to give some information about the ruby versioning in the Gemfile and when capistrano-rails runs the manifest backup task, it runs a cd command to get in the app project folder and rvm information was also returning and deploy was raising en error as a result.

To solve this, either

rvm rvmrc warning ignore allGemfiles

can be run and rvm messages can be disabled server wide or you can create a file named .ruby-version in the root path of the project and set the ruby version inside. For ex:

2.2.4

As I understand .ruby-version is used for rbenv but somehow it is disabling the rvm messages as well.

Hope it helps someone else too

Upvotes: 2

coletrain
coletrain

Reputation: 2849

Rails 4+ is very picky about specific versioning of some gems. Try updating your gemfile to the following:

group :development, :test do
  gem 'capistrano', '~> 3.4.0'
  gem 'capistrano-rvm'
  gem 'capistrano-bundler', '~> 1.1.2'
  gem 'capistrano-rails', '~> 1.1'
  gem 'capistrano-passenger'
end

Upvotes: 0

Related Questions