3

I'm trying to convert an old project from cap2 to cap3. After deleting the old Capfile, running cap install gives me:

$ cap install
(Backtrace restricted to imported tasks)
cap aborted!
No Rakefile found (looking for: capfile, Capfile, capfile.rb, Capfile.rb, /usr/lib/ruby/vendor_ruby/Capfile)
/usr/bin/cap:3:in `<main>'
(See full trace by running task with --trace)

isn't the install command meant to create the Capfile?

I get the same error if I run the cap install command on a new project (= empty folder).

I'm using version 3.4.0.

Ahmed farag mostafa
  • 2,802
  • 2
  • 14
  • 33
Tim Fountain
  • 33,093
  • 5
  • 41
  • 69
  • Have you tried it with bundle exec before it? – will_in_wi May 02 '16 at 20:12
  • This is not a ruby project (I installed the debian capistrano package). I was hoping to avoid having to setup bundler, a Gemfile and specific version of Ruby just to get this up and running, but I'll give that a go. – Tim Fountain May 04 '16 at 14:00
  • I avoid distro provided repackaging of Ruby gems, because they don't always work, and are rarely updated. I would suggest using Bundler and Ruby directly, otherwise I have no idea how to help with this. – will_in_wi May 04 '16 at 14:46

4 Answers4

4

I setup a test environment and re-produced the error:

$ cap install
(Backtrace restricted to imported tasks)
cap aborted!
No Rakefile found (looking for: capfile, Capfile, capfile.rb,  Capfile.rb, /usr/lib/ruby/vendor_ruby/Capfile)
/usr/bin/cap:3:in `<main>'
(See full trace by running task with --trace)

$ cap --trace install
cap aborted!
No Rakefile found (looking for: capfile, Capfile, capfile.rb,  Capfile.rb, /usr/lib/ruby/vendor_ruby/Capfile)
/usr/lib/ruby/vendor_ruby/rake/application.rb:684:in `raw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:94:in `block in load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:176:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:93:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:77:in `block in run'
/usr/lib/ruby/vendor_ruby/rake/application.rb:176:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:75:in `run'
/usr/lib/ruby/vendor_ruby/capistrano/application.rb:15:in `run'
/usr/bin/cap:3:in `<main>'

Located Capfile and ran the command

$ cap --rakefile /usr/lib/ruby/vendor_ruby/capistrano/templates/Capfile install
mkdir -p config/deploy
create config/deploy.rb
create config/deploy/staging.rb
create config/deploy/production.rb
mkdir -p lib/capistrano/tasks
create Capfile
Capified

It works.

Raju
  • 119
  • 1
  • 3
1

I had the same problem, my capistrano used to work fine, but something happened. I believe i updated my ruby in some moment and the capistrano stopped to work. So when i ran cap install the result was:

enter image description here

So i discovered that the Capfile changed directory, from /usr/lib/ruby/vendor_ruby/Capfile to /usr/lib/ruby/vendor_ruby/capistrano/templates/Capfile. So to work i used the command cap --rakefile /usr/lib/ruby/vendor_ruby/capistrano/templates/Capfile install and it worked for me.

1

If you have installed Ruby & Capistrano for debian package then the Capfile can be now found in directory /usr/lib/ruby/vendor_ruby/capistrano/templates/Capfile. So use the command cap --rakefile /usr/lib/ruby/vendor_ruby/capistrano/templates/Capfile install indicating the right path to Capfile.

iamuser2
  • 1,041
  • 1
  • 7
  • 4
0

$ rbenv rehash

Since I am using rbenv, the above command worked for me!