#30 ✓resolved
Jay Phillips

Rails initializer will conflict with Adhearsion if Rails gem used by app is not the newest on the system

Reported by Jay Phillips | June 27th, 2008 @ 09:32 PM

I had this issue when I used the Rails initializer to load in a Rails 2.0.2 app with a Rails 2.1.0 gem installed on the system.

Adhearsion simply does require "active_support" and takes in the latest version on the system. This conflicts with Rails because Rails requires its activesupport gem be the exact version as the Rails app,

The solution seems to be having the Rails initializer initialize before requiring in active_support. Argh.

Sample output:

  ~/Desktop/myahnapp % ahn -
  /Library/Ruby/Site/1.8/rubygems.rb:142:in `activate': can't activate activesupport (= 2.0.2, runtime), already activated activesupport-2.1.0 (Gem::Exception)
  	from /Library/Ruby/Site/1.8/rubygems.rb:158:in `activate'
  	from /Library/Ruby/Site/1.8/rubygems.rb:157:in `each'
  	from /Library/Ruby/Site/1.8/rubygems.rb:157:in `activate'
  	from /Library/Ruby/Site/1.8/rubygems.rb:49:in `gem'
  	from /Users/jicksta/Desktop/myahnapp/gui/config/boot.rb:59:in `load_rails_gem'
  	from /Users/jicksta/Desktop/myahnapp/gui/config/boot.rb:53:in `load_initializer'
  	from /Users/jicksta/Desktop/myahnapp/gui/config/boot.rb:39:in `run'
  	from /Users/jicksta/Desktop/myahnapp/gui/config/boot.rb:11:in `boot!'
  	 ... 17 levels...
  	from /Users/jicksta/Desktop/0.8.0/lib/adhearsion/cli.rb:70:in `start'
  	from /Users/jicksta/Desktop/0.8.0/lib/adhearsion/cli.rb:18:in `send'
  	from /Users/jicksta/Desktop/0.8.0/lib/adhearsion/cli.rb:18:in `execute!'
  	from /Users/jicksta/Desktop/0.8.0/bin/ahn:28

Comments and changes to this ticket

  • Jay Phillips

    Jay Phillips September 18th, 2008 @ 09:51 PM

    • State changed from “new” to “resolved”
    • Tag changed from rails to rails

    This is now fixed. In trunk you can specify gem versions in .ahnrc to override gem require() statements that may haphazardly pull in the latest version and conflict with another lib.

    In .ahnrc:

    gems:

    activerecord:
        version: >= 2.1.0
    
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Shared Ticket Bins

People watching this ticket

Tags

Pages