capistrano / rvm

MIT License
140 stars 47 forks source link

require 'capistrano/rvm' Error cannot load such file #6

Closed edwinlunando closed 11 years ago

edwinlunando commented 11 years ago

Hi, I want to use Capistrano 3.0.0.

gem 'capistrano',  '~> 3.0.0'
gem 'capistrano-rails'
gem 'capistrano-rvm', github: 'capistrano/rvm'

This is my Capfile

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'

When I run cap, it show errors like this

cap aborted!
cannot load such file -- capistrano/rvm
/home/edwinlunando/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/home/edwinlunando/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/home/edwinlunando/Projects/edu-lab-website/Capfile:18:in `<top (required)>'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/lib/capistrano/application.rb:22:in `load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/lib/capistrano/application.rb:12:in `run'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/bin/cap:3:in `<top (required)>'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>'
Kriechi commented 11 years ago

Did you bundle install (or maybe bundle update) - because it looks like it cannot find the RVM plugin for Capistrano....

edwinlunando commented 11 years ago

@Kriechi Of course. I've run it so many times because I thought I forgot to run bundle install. This is the prove.

Using capistrano (3.0.0) 
Using capistrano-rails (1.0.0) 
Using capistrano-rvm (0.0.1) from git://github.com/capistrano/rvm.git (at master) 

I do not understand what is wrong.

Kriechi commented 11 years ago

Whats in your Capfile on line 18? Your are using Rails without the bundler? Maybe try to require the bundler plugin in your Capfile

edwinlunando commented 11 years ago
  1. It is the require 'capistrano/rvm'.
  2. No, I'm using Rails 4.0.0 with bundler.
  3. Here are my full capfile without the comment'
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }

Here are the errors

cannot load such file -- capistrano/rvm
/home/edwinlunando/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/home/edwinlunando/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/home/edwinlunando/Projects/edu-lab-website/Capfile:3:in `<top (required)>'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/lib/capistrano/application.rb:22:in `load_rakefile'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/lib/capistrano/application.rb:12:in `run'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/bin/cap:3:in `<top (required)>'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load'
/home/edwinlunando/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>'
kirs commented 11 years ago

Do you call cap with bundle exec cap deploy?

Kriechi commented 11 years ago

@edwinlunando if you are using Rails 4 with bundler, I think you should also add the bundler plugin.

BTW: you don't have to require both rails parts on it's own. require 'capistrano/rails' should be enough

edwinlunando commented 11 years ago

@kirs Wow, That command is running smoothly. Why do I need to use bundle exec? Thank you. :+1:

@Kriechi Alright, many thanks for the tip.. It running now :+1:

kirs commented 11 years ago

Why do I need to use bundle exec

http://stackoverflow.com/questions/6588674/what-does-bundle-exec-rake-mean

rceee commented 10 years ago

I am running

bundle exec cap deploy

with the latest version (3.1.0) and still getting

cap aborted! cannot load such file -- capistrano/rvm

mpapis commented 10 years ago

where do you load capistrano/rvm is the gem installed? have you added it to your Gemfile?

vibze commented 10 years ago

Just had this message on me. Added gem 'capistrano-rvm' to Gemfile and it works.

KelvinMutuma commented 10 years ago

If you are using capistrano 3.1.0 just do

cap production deploy

without the bundle exec part

arogachev commented 8 years ago

If you are using rvm gemsets, make sure to switch to gemset with capistrano/rvm before deploy. In my case it was a reason of problem.