Being the masochist that I am, I gave the new release candidate of Rails a spin on the first day. Lots of stuff changing. Took the better part of the day on my main project to get things up and running. Turned out to be the new assets stuff creating a bit of havoc. The main project has had a lot of developers and some decisions were made that I don’t agree with and it keeps coming back to bite me.
But tonights post is about my second attempt to give 3.2 a spin. I have a small play project that has a ways to go yet, but also has some decent functionality already in. I wanted to give the rails 3.2 a spin there thinking it was less complex than my earlier project.
Once I got past a bad download of gem files (thanks RVM for making it easy to cleanup these messes), I got the app to the point I thought it would run. BLAM doesn’t even get out of the gate. Got the error below:
/Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.0.rc1/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.0.rc1/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.0.rc1/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.0.rc1/lib/active_record/model_schema.rb:219:in `table_exists?'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.0.rc1/lib/active_record/base.rb:413:in `inspect'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:190:in `inspect'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:190:in `start'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:352:in `block in compile'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:351:in `each'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:351:in `compile'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:381:in `__define_runner'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:426:in `block in __update_callbacks'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:423:in `each'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:423:in `__update_callbacks'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/callbacks.rb:492:in `set_callback'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activemodel-3.2.0.rc1/lib/active_model/validations.rb:139:in `validate'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activemodel-3.2.0.rc1/lib/active_model/validations/with.rb:95:in `block in validates_with'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activemodel-3.2.0.rc1/lib/active_model/validations/with.rb:83:in `each'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activemodel-3.2.0.rc1/lib/active_model/validations/with.rb:83:in `validates_with'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.0.rc1/lib/active_record/validations/uniqueness.rb:176:in `validates_uniqueness_of'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/acts-as-taggable-on-2.2.1/lib/acts_as_taggable_on/tag.rb:17:in `<class:Tag>'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/acts-as-taggable-on-2.2.1/lib/acts_as_taggable_on/tag.rb:2:in `<module:ActsAsTaggableOn>'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/acts-as-taggable-on-2.2.1/lib/acts_as_taggable_on/tag.rb:1:in `<top (required)>'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/dependencies.rb:251:in `require'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0.rc1/lib/active_support/dependencies.rb:251:in `require'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/acts-as-taggable-on-2.2.1/lib/acts-as-taggable-on.rb:19:in `<top (required)>'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /Users/bleeper/work/FindItNearby/config/application.rb:9:in `<top (required)>'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0.rc1/lib/rails/commands.rb:53:in `require'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0.rc1/lib/rails/commands.rb:53:in `block in <top (required)>'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0.rc1/lib/rails/commands.rb:50:in `tap'
from /Users/bleeper/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0.rc1/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Some careful googling led me to this ticket in acts_as_taggable_on. Now, the developer there seems to have his head in the sand a bit, waiting to address what seems to be a significant change needed in the gem until after GA of rails 3.2. This is rails after all, and I am not the only one looking ahead thinking that this release will be GA by the time I go live, so I should start getting used to it now. Alas I guess if I want to use the main gem and not a fork (already one out there that may work), I will just have to wait. Not really winning me over on the future of this gem.
Now I know this is open source and all and it is likely this guys side project, but if you are going to play in rails and this is a pretty popular gem, you have to stay on top of things.
Follow up. There is a workaround posted now for this issue, but still no idea when this gem will be fully rewritten to work with Rails 3.2
Heya, great posts -where is the workaround?
I’m using tags on my development app -& ran into the same frustration that you did, lol.
Thank You,
James
There is an issue on Github for the problem. Basically though you put a :require => false in the gemfile for acts-as-taggable-on, then in an initializer put require ‘acts_as_taggable_on’. Causes it to load differently I guess. I didn’t dig deeper yet. The fundamental problem is that the way acts-as-taggable-on hooks into active record is supposed to be an engine now. The project is having trouble keeping up with rails changes. There were a lot of changes in 3.1 I guess that gave them work. There is a pull request that has it built as an engine on the issue about it not working in 3.2. With 3.2 being released now there may be a permanent fix.
Thank you Bill for your in-depth comment, you’re awesome.
There is always something hidden due to new updates, lol.