cap deploy aborted at task deploy:assets:precompile (with capistrano + capistrano-bundler + capistrano-rvm)

932 views
Skip to first unread message

Slava Kanaykin

unread,
Jan 13, 2014, 12:07:06 AM1/13/14
to capis...@googlegroups.com
Using: Capistrano + capistrano-bundler + capistrano-rails +capistrano-rvm
Problem: 
> cap production deploy
...
and when deploy:assets:precompile 

... bundle exec rake assets:precompile
bash: bundle: command not found
cap aborted!

we need "rvm use 2.0.0 do bundle exec rake ...." , but there is only "bundle exec rake"

Or such combination ( rvm + bundle) is not allowed?

-------------------------------------------

Versions:
  • Ruby 2.0.0
  • Capistrano 3.0.1, capistrano-bundler (1.1.1), capistrano-rails (1.1.0), capistrano-rvm (0.0.3)
  • Rake 10.1.1 / Rails 4.0.2 / etc
Platform:
  • Working on Linux 3.8.0-35-generic #50~precise1-Ubuntu SMP Wed Dec 4 17:28:45 UTC 2013 i686 i686 i386 GNU/Linux
  • Deploying to Linux 2.6.32-5-amd64 #1 SMP Mon Sep 23 22:14:43 UTC 2013 x86_64 GNU/Linux
Logs:
  •  INFO [8212b6b0] Running /usr/local/rvm/bin/rvm 2.0.0 do bundle --gemfile /home/deploy/projects/op1/releases/20140113042011/Gemfile --path /home/deploy/projects/op1/shared/bundle --deployment --quiet --binstubs /home/deploy/projects/op1/shared/bin --without development test on gotar.ru
    DEBUG [8212b6b0] Command: cd /home/
    deploy/projects/op1/releases/20140113042011 && /usr/local/rvm/bin/rvm 2.0.0 do bundle --gemfile /home/deploy/projects/op1/releases/20140113042011/Gemfile --path /home/deploy/projects/op1/shared/bundle --deployment --quiet --binstubs /home/deploy/projects/op1/shared/bin --without development test  
     INFO [8212b6b0] Finished in 1.831 seconds with exit status 0 (successful).
  • ...
    INFO [58eaf64f] Running bundle exec rake assets:precompile on
    gotar.ru
    DEBUG [58eaf64f] Command: cd /home/
    deploy/projects/op1/releases/20140113042011 && ( RAILS_ENV=production bundle exec rake assets:precompile )
    DEBUG [58eaf64f] bash: bundle: command not found 

Lee Hambley

unread,
Jan 13, 2014, 2:44:31 AM1/13/14
to capistrano
rvm and bundler should work fine together. One of our core team (Kir) is using that setup all the time, and Michal Papis, the RVM maintainer has had a hand in writing the Gem.

There's the "official" capistrano-rvm Gem which we maintain, and the rvm1-capistrano3 Gem maintained by Michal. We know that's a little strange, but Michal has slightly different goals for the super right integration of RVM with Capistrano (the big sticking point is encouraging the deploy-time installation of Rubies, which we think is a bad idea)

You should definitely try both. We had been working with Michal to align the two Gems a bit better, but I haven't done a good enough job of getting that to happen yet.

The final thing to say, is that what you are doing should work, there's no need to switch to the other one. It would help us a lot if you could post (with as few modifications as possible) your Capfile, deploy.rb, and your stage files. It might be some load-order dependent stuff.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/c339358d-88fc-4e0d-bf7b-04d63164cf46%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Slava Kanaykin

unread,
Jan 13, 2014, 3:54:56 AM1/13/14
to capis...@googlegroups.com
Files are in attaches.
Made from templates (+ some strings for unicorn).

понедельник, 13 января 2014 г., 9:07:06 UTC+4 пользователь Slava Kanaykin написал:
production.rb
deploy.rb
Capfile.example

Lee Hambley

unread,
Jan 13, 2014, 4:10:58 AM1/13/14
to capistrano

You have no Capfile?

Sent from my Nexus 4.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.

Slava Kanaykin

unread,
Jan 13, 2014, 4:33:56 AM1/13/14
to capis...@googlegroups.com
attach Capfile raise error
So i rename it to Capfile.example

понедельник, 13 января 2014 г., 9:07:06 UTC+4 пользователь Slava Kanaykin написал:
Using: Capistrano + capistrano-bundler + capistrano-rails +capistrano-rvm

Lee Hambley

unread,
Jan 13, 2014, 4:35:02 AM1/13/14
to capistrano
Thanks for clarification. I'd say for a start transpose the capistrano-rvm and capistrano-bundler includes (it shouldn't make a difference, but it's worth a try)

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.

Slava Kanaykin

unread,
Jan 13, 2014, 5:04:03 AM1/13/14
to capis...@googlegroups.com
i tryed some combinations before and now again - no visible changes.
But what i have in all combinations:
capistrano-rvm works:  it adds "/usr/local/rvm/bin/rvm 2.0.0 do " before "bundle"  (log from first message)
capistrano-bundler works: it adds  "bundle exec" before "rake assets:precompile"
if they must to add  "bundle exec" before "rake assets:precompile" and then "/usr/local/rvm/bin/rvm 2.0.0 do " before "bundle exec" - i will put some 'puts "bla bla"' to capistrano-rvm and -bundler sources and look at order of messages.

Combinations:

require 'capistrano/rvm'
require 'capistrano/rails'

require 'capistrano/rvm'
require 'capistrano/rails'
require 'capistrano/bundler'

require 'capistrano/rails'
require 'capistrano/rvm'
require 'capistrano/bundler'

require 'capistrano/rails'
require 'capistrano/rvm'

require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/rvm'

require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'

понедельник, 13 января 2014 г., 13:35:02 UTC+4 пользователь Lee Hambley написал:

Lee Hambley

unread,
Jan 13, 2014, 5:15:41 AM1/13/14
to capistrano
Does Ruby 2.0.0 have the bundler gem installed on that server? That's not a part of the bundle integration from Capistrano.

Slava Kanaykin

unread,
Jan 13, 2014, 5:59:39 AM1/13/14
to capis...@googlegroups.com
server$ rvm use 2.0.0 do bundle --version
Bundler version 1.3.5

if i type 
server$ bundle
it will be from rvm use 1.9.3 - set as default (for other projects)

So i need all 'bundle exec' commands with  'rvm use 2.0.0 do bundle exec' 

I used Capistrano v2 for this project some months past year. And some days ago i tried Capistrano v3 for this project:
1) change Gemfile
2) push new Gemfile and Gemfile.lock in repo
3) change Capfile, deploy.rb, deploy/production.rb ('cap install' and edit them)
4) from notebook> rvm use 2.0.0 do bundle exec cap production deploy  (in 2.1.0 same)

and have  INFO [73ecdadd] Running bundle exec rake assets:precompile ...

I was waiting for

 INFO [73ecdadd] Running /usr/local/rvm/bin/rvm 2.0.0 do bundle exec rake assets:precompile ....

but ...

понедельник, 13 января 2014 г., 14:15:41 UTC+4 пользователь Lee Hambley написал:

Slava Kanaykin

unread,
Jan 13, 2014, 2:03:10 PM1/13/14
to capis...@googlegroups.com
I have changed capistrano-rvm-0.0.3/lib/capistrano/tasks/rvm.rake :

SSHKit.config.command_map = Hash.new do |hash, key|
if fetch(:rvm_map_bins).include?(key.to_s)
  puts "check rvm 1"                                                                            #  here (1)
  hash[key] = "#{fetch(:rvm_path)}/bin/rvm #{fetch(:rvm_ruby_version)} do #{key}"
elsif key.to_s == "rvm"
  puts "check rvm 2"                                                                            #  here (2)
hash[key] = "#{fetch(:rvm_path)}/bin/rvm"
else
  puts "check rvm 3: " + key.to_s                                                         #  and here (3)
hash[key] = key
end
end

So... before every Running ... i have "check rvm 3: ...." or not any string at all.
Then 
check rvm 1
 INFO [46af5a18] Running rvm use 2.0.0 do bundle --gemfile ....

and then  there was not any "check rvm" strings
and before "Running bundle exec rake assets:precompile" too. 

Is it normal?

понедельник, 13 января 2014 г., 9:07:06 UTC+4 пользователь Slava Kanaykin написал:
Using: Capistrano + capistrano-bundler + capistrano-rails +capistrano-rvm

Slava Kanaykin

unread,
Jan 13, 2014, 2:30:31 PM1/13/14
to capis...@googlegroups.com
I update capistrano-rvm to 0.1.0 (from 0.0.3) and it works.
Sorry for my panic questions.

понедельник, 13 января 2014 г., 9:07:06 UTC+4 пользователь Slava Kanaykin написал:
Using: Capistrano + capistrano-bundler + capistrano-rails +capistrano-rvm
Reply all
Reply to author
Forward
0 new messages