Topic: Can't run Capistrano - dependency error


I've installed Capistrano on my Ubuntu with the following commands

sudo gem install capistrano
sudo gem install railsless-deploy # I want to deploy a PHP website
sudo gem install capistrano-ext

When I run

capify .

in my deployment folder, have got an error:

Same error with other Capistrano command like a simple

cap -h


/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find capistrano (>= 0) amongst [POpen4-0.1.4, Platform-0.4.0, addressable-2.3.4, addressable-2.3.2, bundler-1.3.5, bundler-1.2.3, bundler-1.0.21, chunky_png-1.2.8, chunky_png-1.2.7, coderay-1.0.9, coderay-1.0.8, commonjs-0.2.6, compass-0.12.2, compass-normalize-1.4.3, compass-normalize-1.4.2, compass-recipes-0.3.0, em-websocket-0.5.0, em-websocket-0.4.0, eventmachine-1.0.3, eventmachine-1.0.0, ffi-1.7.0, ffi-1.3.1, forge-0.5.0, formatador-0.2.4, fssm-0.2.10, fssm-0.2.9, guard-1.8.0, guard-1.7.0, guard-1.6.1, guard-1.3.3, guard-livereload-1.3.0, guard-livereload-1.2.1, guard-livereload-1.1.3, guard-livereload-1.0.1, hike-1.2.2, hike-1.2.1, http_parser.rb-0.5.3, json-1.7.7, json-1.7.6, json-1.6.5, less-2.3.2, less-2.2.2, less-2.0.8, libv8-, libv8-, libv8-, listen-1.0.2, listen-0.7.3, listen-0.7.2, lumberjack-1.0.3, lumberjack-1.0.2, method_source-0.8.1, multi_json-1.7.2, multi_json-1.5.0, open4-1.3.0, pry-, pry-0.9.12, pry-, rack-1.5.2, rack-1.5.0, rack-1.3.5, rake-10.0.4, rake-10.0.3, rake-, rb-fsevent-0.9.3, rb-inotify-0.9.0, rb-kqueue-0.2.0, ref-1.0.4, ref-1.0.2, rubygems-update-2.0.3, rubygems-update-1.8.25, rubyzip-0.9.9, sass-3.2.8, sass-3.2.7, sass-3.2.5, sassy-buttons-0.1.4, slick-buttons-0.0.6, slop-3.4.4, slop-3.4.3, sprockets-2.9.3, sprockets-2.9.2, sprockets-2.8.2, sprockets-2.0.3, sprockets-helpers-1.0.1, sprockets-helpers-1.0.0, sprockets-helpers-0.8.0, sprockets-sass-1.0.0, sprockets-sass-0.9.1, sprockets-sass-0.3.0, stitch-0.1.6, therubyracer-0.11.4, therubyracer-0.11.3, therubyracer-0.9.9, thor-0.18.1, thor-0.17.0, thor-0.15.4, tilt-1.3.7, tilt-1.3.3, yui-compressor-0.9.6] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/cap:22:in `<main>'

I'm a noob with Capistrano and Ruby

Any idea to resolve this problem ? Thx

Re: Can't run Capistrano - dependency error

I tried to capfile with the root user and Capistrano runs correctly

sudo capfile .

Is it a problem to run Capistrano as root ?

Re: Can't run Capistrano - dependency error

I installed Capistrano as the root user that's why I can't run "cap cmd" without sudo.

If I install Capistrano like this : "gem install capistrano" (whithout sudo) then I can run cap cmd witout sudo.