Skip to content

Crash on loading rails #112

@nagi

Description

@nagi

To recreate:

With Bundler version 1.8.3, Rails version 4.2.0. I don't know if it's relevant, but I'm not using rvm.

rails new foobar
cd foobar
echo "gem 'capistrano', '= 2.15.4', group: :development" >> Gemfile
echo "gem 'rvm-capistrano', '= 1.5.6', group: :development" >> Gemfile
bundle install
bundle exec capify .
bundle exec rails console
/Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/capistrano-2.15.4/lib/capistrano/configuration/loading.rb:18:in `instance': Please require this file from within a Capistrano recipe (LoadError)
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/base.rb:16:in `rvm_with_capistrano'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/helpers/_cset.rb:3:in `<top (required)>'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/base.rb:1:in `require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/base.rb:1:in `<top (required)>'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/selector.rb:1:in `require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano/selector.rb:1:in `<top (required)>'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano.rb:3:in `require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rvm-capistrano-1.5.6/lib/rvm/capistrano.rb:3:in `<top (required)>'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/runtime.rb:85:in `require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/runtime.rb:85:in `rescue in block in require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/runtime.rb:68:in `block in require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/runtime.rb:61:in `each'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler/runtime.rb:61:in `require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.3/lib/bundler.rb:134:in `require'
    from /Users/nagi/rails/foobar/config/application.rb:7:in `<top (required)>'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/application.rb:82:in `require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/application.rb:82:in `preload'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/application.rb:143:in `serve'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/application.rb:131:in `block in run'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/application.rb:125:in `loop'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/application.rb:125:in `run'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/nagi/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'

Possible Workarounds

1 - Switch the gem load order so rvm-capistrano loads first:

gem 'rvm-capistrano', '= 1.5.6', group: :development
gem 'capistrano', '= 2.15.4', group: :development

2 - Don't require 'rvm-capistrano` in Gemfile

Although I'm not sure what the implications of this are.

gem 'rvm-capistrano', '= 1.5.6', group: :development, require: false

Other Info

http://stackoverflow.com/questions/28461965/please-require-this-file-from-within-a-capistrano-recipe-loaderror

If you need any more info just shout.

Many Thanks,
Nagi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions