capistrano / rvm

MIT License
140 stars 47 forks source link

rvm.rake:67: undefined method `join' for nil:NilClass #7

Closed kernow closed 11 years ago

kernow commented 11 years ago

I'm having trouble with this line:

execute :rvm, "wrapper #{fetch(:rvm_ruby_version)} #{fetch(:application)} #{fetch(:rvm_map_bins).join(" ")}"

When running the command:

cap production rvm:check

My Gemfile looks like this:

group :development do
  gem 'capistrano', github: 'capistrano/capistrano'
  gem 'capistrano-rails'
  gem 'capistrano-bundler'
  gem 'capistrano-rvm', github: 'capistrano/rvm'
end

And the non standard parts of deploy.rb:

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

set :rvm_ruby_version, '2.0.0'
set :rvm_type, :user

According to this issue https://github.com/capistrano/rvm/issues/4 rvm_map_bins should be set when load:defaults is invoked. It is being run, this is the trace output:

** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:check (first_time)
** Invoke rvm:hook (first_time)
** Execute rvm:hook
** Invoke rvm:init (first_time)
** Execute rvm:init
** Invoke rvm:create_wrappers (first_time)
** Execute rvm:create_wrappers
cap aborted!
undefined method `join' for nil:NilClass
/Users/jamied/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/rvm-76d7cd6bd864/lib/capistrano/tasks/rvm.rake:67:in `block (3 levels) in <top (required)>'
/Users/jamied/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-0.0.34/lib/sshkit/backends/netssh.rb:42:in `instance_exec'
/Users/jamied/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-0.0.34/lib/sshkit/backends/netssh.rb:42:in `run'
/Users/jamied/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sshkit-0.0.34/lib/sshkit/runners/parallel.rb:29:in `block (2 levels) in execute'
Tasks: TOP => rvm:create_wrappers
kernow commented 11 years ago

A little bit more info. Looks like the load:defaults task from capistrano-rvm is not being run while load:defaults in capistrano is running.

kernow commented 11 years ago

Fixed, it was a load order issue!