Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with latest capistrano-bundler #6

Closed
sauliusgrigaitis opened this issue Nov 26, 2013 · 10 comments
Closed

Doesn't work with latest capistrano-bundler #6

sauliusgrigaitis opened this issue Nov 26, 2013 · 10 comments

Comments

@sauliusgrigaitis
Copy link

I did new deployment setup today and figured out that rvm1-capistrano3 doesn't work any more with latest capistrano-bundler. It just doesn't use rvm-auto.sh when running rake:

INFO [a791c197] Running bundle exec rake assets:precompile on domain.com
DEBUG [a791c197] Command: cd /path/to/app/releases/20131126140408 && ( RAILS_ENV=staging bundle exec rake assets:precompile )
DEBUG [a791c197]        bash: bundle: command not found
cap aborted!
rake stdout: Nothing written
rake stderr: Nothing written
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/command.rb:94:in `exit_status='
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:138:in `block (4 levels) in _execute'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `call'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `do_request'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:561:in `channel_request'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:205:in `process'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:269:in `wait'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:160:in `block (2 levels) in _execute'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:514:in `call'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:205:in `process'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:162:in `block in _execute'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:119:in `tap'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:119:in `_execute'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:66:in `execute'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.0/lib/capistrano/tasks/assets.rake:63:in `block (6 levels) in <top (required)>'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/abstract.rb:89:in `with'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.0/lib/capistrano/tasks/assets.rake:62:in `block (5 levels) in <top (required)>'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/abstract.rb:81:in `within'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.0/lib/capistrano/tasks/assets.rake:61:in `block (4 levels) in <top (required)>'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:54:in `run'
/home/user/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.2.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)

Temporary solution is to downgrade capistrano-bundler and sshkit

diff --git a/Gemfile b/Gemfile
index d8d740e..7d25624 100644
--- a/Gemfile
+++ b/Gemfile
@@ -35,8 +35,9 @@ end
 group :development do
   gem 'capistrano', '3.0.1'
   gem 'rvm1-capistrano3'
-  gem 'capistrano-bundler'
+  gem 'capistrano-bundler', '1.0.0'
   gem 'capistrano-rails'
+  gem 'sshkit', '1.1.0'
 end

 # Use ActiveModel has_secure_password
diff --git a/Gemfile.lock b/Gemfile.lock
index c41cd92..b2f46be 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -32,9 +32,8 @@ GEM
       i18n
       rake (>= 10.0.0)
       sshkit (>= 0.0.23)
-    capistrano-bundler (1.1.0)
-      capistrano (~> 3.0)
-      sshkit (>= 1.2.0)
+    capistrano-bundler (1.0.0)
+      capistrano (>= 3.0.0.pre)
     capistrano-rails (1.1.0)
       capistrano (>= 3.0.0)
       capistrano-bundler (>= 1.0.0)
@@ -105,8 +104,8 @@ GEM
       actionpack (>= 3.0)
       activesupport (>= 3.0)
       sprockets (~> 2.8)
-    sshkit (1.2.0)
-      net-scp (>= 1.1.2)
+    sshkit (1.1.0)
+      net-scp
       net-ssh
       term-ansicolor
     term-ansicolor (1.2.2)
@@ -131,7 +130,7 @@ PLATFORMS

 DEPENDENCIES
   capistrano (= 3.0.1)
-  capistrano-bundler
+  capistrano-bundler (= 1.0.0)
   capistrano-rails
   coffee-rails (~> 4.0.0)
   jbuilder (~> 1.2)
@@ -141,5 +140,6 @@ DEPENDENCIES
   rvm1-capistrano3
   sass-rails (~> 4.0.0)
   sdoc
+  sshkit (= 1.1.0)
   turbolinks
   uglifier (>= 1.3.0)
@mpapis
Copy link
Member

mpapis commented Nov 26, 2013

capistrano-bundler should not be used with rvm1-capistrano3 - it automatically uses bundler when needed.

as for installing gems it's as simple as:

set :bundle_without, %w{development test}.join(' ')
set :bundle_roles, :all
namespace :bundler do
  desc "Install gems with bundler."
  task :install do
    on roles fetch(:bundle_roles) do
      within release_path do
        execute :bundle, "install", "--without #{fetch(:bundle_without)}"
      end
    end
  end
end
before 'deploy:updated', 'bundler:install'

@sauliusgrigaitis
Copy link
Author

I'm really not happy with this :)

  1. It's not mentioned in README.

  2. Deployment files should be as clean as possible. I really don't want to put this code into deploy.rb, and I don't want to put this bundle:install task in seperate file or in some other way manually handle it. Requiring capistrano-bundler was clean and nice way to get bundler related things resolved.

  3. This bundle:install task doesn't work in my setup. My setup is sudoless , so I need to install gems somewhere in capistrano tree. Passing path param solved it. So imagine that different setups will need different params passed to this custom bundle:install task. That's not good.

Is there any reason why capistrano-bundler shouldn't be used with rvm1-capistrano3 ? Everything worked perfectly until capistrano-bundler update. But from now peeps will need to waste time on this bundler related issues.

@mpapis
Copy link
Member

mpapis commented Nov 28, 2013

added a task to install gems with rubygems (using Gemfile) and updated documentation, can you please test it with head version of this repository? please take into consideration this #7 (comment)

@mpapis
Copy link
Member

mpapis commented Dec 2, 2013

it's released as 1.0.0, assuming it's good this way - please let me know if there are still issues / problems / concerns.

@mpapis mpapis closed this as completed Dec 2, 2013
@oblakogroup
Copy link

I have rvm1-capistrano3 (1.1.1) and I still get the problem described by sauliusgrigaitis.
image
Though your snipped from the second comment solves my problem, I'd like to know: Am I missing something, or the problem isn't fixed?

@mpapis
Copy link
Member

mpapis commented Jan 29, 2014

@oblakogroup I would need to see all output from the deploy, please gist it

@oblakogroup
Copy link

@mpapis
Copy link
Member

mpapis commented Jan 29, 2014

it looks like you used rvm1:install:gems task, can you get back to the capistrano-bundler task for installing gems?

@oblakogroup
Copy link

I was using capistrano-bundler without rvm1:install:gems at the very beginning, but it didn't work. Now after changing back to capistrano-bundler it works very well.

Sorry for bothering you! And thank you very much for response!!

@mpapis
Copy link
Member

mpapis commented Jan 29, 2014

yeah capistrano-bundler was fixed recently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants