
ExtLib Inflector issue (missing method implementation?)
Reported by Felipe Seixas | June 8th, 2010 @ 10:13 PM
Sorry about my english and poor Ruby knowledge.
I got dm-core 1.0.0, my Rails version is 2.3.8 (also tried using
2.3.5).
Created a new rails project and the only things I did inside
environment.rb was modifying/including those lines:
# included config.gem "do_sqlite3" config.gem "dm-core"
# uncommented config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
After running script/server I got some errors.
Below is the complete stacktrace:
=> Booting Mongrel => Rails 2.3.8 application starting on
http://0.0.0.0:3000
/Library/Ruby/Gems/1.8/gems/dm-core-1.0.0/lib/dm-core.rb:49:
warning: already initialized constant Inflector
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/module/aliasing.rb:33:in
alias_method': undefined method
inflections' for module
Extlib::Inflection' (NameError)
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/module/aliasing.rb:33:in `alias_method_chain'
from /Library/Ruby/Gems/1.8/gems/actionpack-2.3.8/lib/action_controller/routing.rb:385
from /Library/Ruby/Gems/1.8/gems/actionpack-2.3.8/lib/action_controller/routing.rb:377:in `module_eval'
from /Library/Ruby/Gems/1.8/gems/actionpack-2.3.8/lib/action_controller/routing.rb:377
from /Users/felipeseixas/Projects/rails/espelho_de_vendas/config/initializers/new_rails_defaults.rb:14
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:145:in `load'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.8/lib/initializer.rb:622:in `load_application_initializers'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.8/lib/initializer.rb:621:in `each'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.8/lib/initializer.rb:621:in `load_application_initializers'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.8/lib/initializer.rb:176:in `process'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
from /Users/felipeseixas/Projects/rails/espelho_de_vendas/config/environment.rb:9
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Library/Ruby/Gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:84
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3
Looking inside some files, I found this line:
Gems/1.8/gems/actionpack-2.3.8/lib/action_controller/routing.rb:385
alias_method_chain :inflections, :route_reloading
On dm-core.rb:49
module ActiveSupport ---> Inflector = Extlib::Inflection end
It seems that DataMapper overwrites Inflector module that already exists in ActiveSupport using new implementation of ExtLib::Inflection class definition and that class does not have defined a method with name "inflections".
I don't really know what "class << self" does eheh.
To work with it I commented the line on dm-core.rb that replaces the implementation of the module Inflector and at least my project have ran well (but not tried to use DataMapper and I don't think it will work fine too).
If this situation is not a bug, please let me know and
understand what have happened. =)
Thanks
Comments and changes to this ticket
-
Dan Kubb (dkubb) June 9th, 2010 @ 12:31 AM
- State changed from new to unconfirmed
- Assigned user set to Martin Gamsjaeger (snusnu)
-
Martin Gamsjaeger (snusnu) June 24th, 2010 @ 06:51 PM
Felipe,
Sorry about getting back to you so late. Unfortunately I'm not really familiar with rails-2.3.x and how datamapper integrates with it, but I can tell you that basically DM-1.0 works with active_support ~> 3.0.0.beta4 or with extlib. It tries to require features exclusive to active_support ~> 3.0.0.betaX and if it fails to do so, it falls back to using extlib. There are known issues when extlib and active_support are both active.
Maybe someone with experience using DM-1.0 with rails-2.3.x can comment on this one?
-
Piotr Solnica (solnic) March 24th, 2011 @ 05:54 AM
- State changed from unconfirmed to not-applicable
- Milestone order changed from 0 to 0
This should no longer be a problem since we removed AS dep
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »