LoadError: Please require this file from within a Capistrano recipe

1,929 views
Skip to first unread message

Lvgarcia

unread,
Feb 12, 2015, 2:38:41 PM2/12/15
to capis...@googlegroups.com
Hi!

I'm trying to deploy an application to linode, I use RailsReady to setup the server. But  I got this error and I don´t know how to resolve it.
Any idea ? Thanks

Versions:
  • Ruby: ruby 2.1.5p273 (2014-11-13 revision 48405) 
  • Capistrano 2.15.4 and rvm-capistrano
  • Rake / Rails / etc: bundler-1.7.6, rake-10.1.0, rvm-1.11.3.9, Rails 4.2
Platform:
  • Working on.... Ubuntu 14.04.1 LTS (GNU/Linux 3.18.5-x86_64-linode52 x86_64)
  • Deploying to.. linode
Logs:
executing "cd -- /var/www/application/releases/20150212173838 && bundle exec rake RAILS_ENV=test RAILS_GROUPS=assets assets:precompile"
 
    [xx.xx.xx.xx] executing command
 ** [out :: xx.xx.xx.xx] rake aborted!
 ** [out :: xx.xx.xx.xx] LoadError: Please require this file from within a Capistrano recipe
 ** [out ::xx.xx.xx.xx] /var/www/application/shared/bundle/ruby/2.1.0/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:18:in `instance'
 ** [out :: xx.xx.xx.xx] /var/www/application/shared/bundle/ruby/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/base.rb:16:in `rvm_with_capistrano'
 ** [out :: xx.xx.xx.xx] /var/www/application/shared/bundle/ruby/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/_cset.rb:3:in `<top (required)>'
 ** [out :: xx.xx.xx.xx] /var/www/application/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
 ** [out :: xx.xx.xx.xx] /var/www/application/shared/bundle/ruby/2.1.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'

...
[out :: xx.xx.xx.xx] LoadError: cannot load such file -- rvm-capistrano
 ** [out :: xx.xx.xx.xx] /usr/local/rvm/gems/ruby-2.1.5/gems/bundler-1.8.0/lib/bundler/runtime.rb:76:in `require'
 ** [out ::xx.xx.xx.xx] /usr/local/rvm/gems/ruby-2.1.5/gems/bundler-1.8.0/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
 ** [out :: xx.xx.xx.xx] /usr/local/rvm/gems/ruby-2.1.5/gems/bundler-1.8.0/lib/bundler/runtime.rb:72:in `each'
 ** [out :: xx.xx.xx.xx] /usr/local/rvm/gems/ruby-2.1.5/gems/bundler-1.8.0/lib/bundler/runtime.rb:72:in `block in require'
 ** [out :: xx.xx.xx.xx] /usr/local/rvm/gems/ruby-2.1.5/gems/bundler-1.8.0/lib/bundler/runtime.rb:61:in `each'
 ** [out :: xx.xx.xx.xx] /usr/local/rvm/gems/ruby-2.1.5/gems/bundler-1.8.0/lib/bundler/runtime.rb:61:in `require'

Files:
  • Capfile
load 'deploy'
load 'deploy/assets'
load 'config/deploy' 
  • deploy.rb
require "bundler/capistrano"
require "capistrano/ext/multistage"
require "rvm/capistrano"
require "delayed/recipes"

set :stages, %(production staging)
set :default_stage, "staging"

set :application, "education_site"
set :user, "e-user"
set :scm, "git"
set :repository, "g...@github.com:xxxxxxx"

set :deploy_via, :remote_cache
set :copy_compression, :bz2
set :git_shallow_clone, 1
set :scm_verbose, true
set :use_sudo, false

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

set :keep_releases, 6
after "deploy:restart", "deploy:cleanup"

# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end
end

# Delayed Job hooks
set :delayed_job_command, "bin/delayed_job"

after "deploy:stop",    "delayed_job:stop"
after "deploy:start",   "delayed_job:start"
after "deploy:restart", "delayed_job:restart"
  • Stage files (staging.rb)
set :rvm_ruby_string, '2.1.5'
set :bundle_without, [:development]
set :rvm_type, :system 

server "xx.xx.xx.xx", :web, :app, :db, :primary => true
set :deploy_to, "/var/www/application"

set :rails_env, 'test'
set :app_env,   'test'

# Whenever
set :whenever_environment, defer { "#{rails_env}" }
set :whenever_identifier, defer { "#{application}_#{stage}" }
set :whenever_command, "bundle exec whenever"
require "whenever/capistrano"

set :shared_children, shared_children + %w{public/uploads}

set :branch, "master"

namespace :robots do
  desc "Symlink robots.txt file to public folder on current"
  task :symlink_robots, :roles => :app do
    run "ln -nfs #{shared_path}/config/robots.txt #{release_path}/public/robots.txt"
  end
  after 'deploy:update_code', 'robots:symlink_robots'
end

troels knak-nielsen

unread,
Feb 12, 2015, 3:22:24 PM2/12/15
to capis...@googlegroups.com
Looks like you're including rvm-capistrano in your Gemfile for production group. You don't want to do that.

Try with something like:

gem 'rvm-capistrano', :require => false

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/af9de7b8-8abb-4580-a399-0629c0a4db35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lee Hambley

unread,
Feb 12, 2015, 3:30:38 PM2/12/15
to Capistrano

I don't think that error comes from Capistrano.

Sent from my Nexus 5.

--

Lee Hambley

unread,
Feb 12, 2015, 4:02:05 PM2/12/15
to Capistrano

Lvgarcia

unread,
Feb 12, 2015, 5:40:16 PM2/12/15
to capis...@googlegroups.com, tro...@knak-nielsen.dk
thank you Troels Knak-nielsen, thats was the problem
Reply all
Reply to author
Forward
0 new messages