Navigation Menu

Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

"already activated" error #758

Closed
francois opened this issue Oct 12, 2010 · 5 comments
Closed

"already activated" error #758

francois opened this issue Oct 12, 2010 · 5 comments

Comments

@francois
Copy link
Contributor

I thought those were supposed to be a thing of the past...

$ bundle exec script/console
Loading development environment (Rails 2.3.9)
no such file to load -- interactive_editor
config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead
config.load_paths= is deprecated and removed in Rails 3, please use autoload_paths= instead
/Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/railties/lib/initializer.rb:271:in `require_frameworks':RuntimeError: can't activate rack (~> 1.1.0, runtime), already activated rack-1.0.1. Make sure all dependencies are added to Gemfile.
/Users/francois/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0/lib/bundler/shared_helpers.rb:106:in `gem': can't activate rack (~> 1.1.0, runtime), already activated rack-1.0.1. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/actionpack/lib/action_controller.rb:34
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/railties/lib/console_app.rb:2
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb/init.rb:254:in `load_modules'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb/init.rb:252:in `each'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb/init.rb:21:in `setup'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb.rb:54:in `start'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/bin/irb:18

Gemfile and friends: http://gist.github.com/621491

We're using this in the context of a Rails application. 2.3.9 to be exact, with one patch applied, which is available here: http://github.com/bloom/rails/tree/adgear-next.

@indirect
Copy link
Member

Let me guess... you didn't remove all your config.gem declarations in your environment.rb?

@indirect
Copy link
Member

To elaborate slightly, if you're getting this error it means Bundler is trying to load rack 1.1.0 but something else other than Bundler has already loaded rack 1.0.1. Bundler obviously can't do anything about gems that are loaded before it itself is loaded, so you have an activation error.

@francois
Copy link
Contributor Author

I unfortunately did remove all traces. If you note, I'm running "bundle exec script/console".

I took the time to make a reproduction app:

rails _2.3.5_ newapp
cd newapp
# Follow steps on http://gembundler.com/rails23.html
curl -o Gemfile http://gist.github.com/raw/621491/2fb79c1e65525ac83c965795287cceb4d709345c/Gemfile
bundle install
# edit config/environment.rb to remove the RAILS_GEM_VERSION constant
bundle exec script/console
Loading development environment (Rails 2.3.9)
no such file to load -- interactive_editor
/Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/railties/lib/initializer.rb:271:in `require_frameworks':RuntimeError: can't activate rack (~> 1.1.0, runtime), already activated rack-1.0.1. Make sure all dependencies are added to Gemfile.
/Users/francois/.rvm/gems/ree-1.8.7-2010.02/gems/bundler-1.0.0/lib/bundler/shared_helpers.rb:106:in `gem': can't activate rack (~> 1.1.0, runtime), already activated rack-1.0.1. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/actionpack/lib/action_controller.rb:34
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/railties/lib/console_app.rb:2
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
        from /Users/francois/.rvm/gems/ree-1.8.7-2010.02/bundler/gems/rails-5d13b079dfef/activesupport/lib/active_support/dependencies.rb:182:in `require'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb/init.rb:254:in `load_modules'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb/init.rb:252:in `each'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb/init.rb:21:in `setup'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/irb.rb:54:in `start'
        from /Users/francois/.rvm/rubies/ree-1.8.7-2010.02/bin/irb:18

Code at http://github.com/francois/bundler-758-repro

@indirect
Copy link
Member

They would be a thing of the past -- if your code didn't declare a dependency on rack ~>1.0.0, and then (at runtime) explicitly demand rack ~>1.1. That is, by definition, an activation error. Just look at your backtrace: action_controller.rb:54.

http://github.com/bloom/rails/blob/adgear-next/actionpack/lib/action_controller.rb#L34
http://github.com/bloom/rails/blob/adgear-next/actionpack/actionpack.gemspec#L27

@francois
Copy link
Contributor Author

Ah, I see. Excellent, sorry for the bother.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants