It would appear that the way the Inflector is used in Ruby on Rails 2.2.2 has changed. There are a few plugins that rely on it's old implementation, notably file_column.
Upon trying to start my app I was getting...
'load_missing_constant': uninitialized constant Inflector
To invoke the inflector you'll now need to use...
ActiveSupport::Inflector
Comments left...
thanks, you saved my time and nerves :)
ishvara at 25 Nov 08 at 15:37
Thanks a lot!! An hour gained is an hour earned!!
Parag at 09 Dec 08 at 18:51
How i invoke this ActiveSupport::Inflector? I put it in what file? Thanks
Eduardo Brazil at 11 Jan 09 at 12:04
How i invoke this ActiveSupport::Inflector? I put it in what file? Thanks
Eduardo Brazil at 11 Jan 09 at 12:23
Hi Eduardo, Two steps to using Inflector in your ruby program. 1)Use the following ruby statement require ‘active_support/inflector’ 2)Then use the fully qualified name ActiveSupport::Inflector instead of Inflector whenever you need Inflector. This problem occurs only moving from rails 2.0.2 to 2.2.2 ; with version 2.0.2 you can just invoke Inflector cheers
kuang oon at 21 Feb 09 at 07:36
Hi Eduardo, Two steps to using Inflector in your ruby program. 1)Use the following ruby statement require ‘active_support/inflector’ 2)Then use the fully qualified name ActiveSupport::Inflector instead of Inflector whenever you need Inflector. This problem occurs only moving from rails 2.0.2 to 2.2.2 ; with version 2.0.2 you can just invoke Inflector cheers
kuang oon at 21 Feb 09 at 14:45
I’m kinda new to rails and I am experimenting with the LiveTree project even tho it has been abandoned. But I need to incorporate this into my project, however i’m getting a similar error that is linked to the inflector.
uninitialized constant LiveTree::ClassMethods::Inflector
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:442:in `load_missing_constant’ C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:77:in `const_missing’ vendor/plugins/live_tree/lib/live_tree.rb:44:in `live_tree’ app/controllers/areas_controller.rb:2
Yes, I’m using windows for development. :(
Can someone please give me a lil help in how to fix this?
Joe at 25 Feb 09 at 14:26
The message: “uninitialized constant LiveTree::ClassMethods::Inflector ” means that the ruby interpreter cannot resolve the name Inflector. Try to resolve the problem in one of the following two ways. 1) In file live_tree.rb, inside module ClassMethods , use the statement: require ‘active_support/inflector’ Then use the fully qualified name ActiveSupport::Inflector instead of Inflector whenever you need Inflector 2)If you are unable to get above to work, search code for Inflector and plonk all the class code for Inflector into the ClassMethods module. hth.
kuang oon at 27 Feb 09 at 15:25
Thank you very much – this solved my problem!
DBaker in Honolulu at 03 Mar 09 at 13:20
THANK YOU solved my problem too!
André Durão at 10 Mar 09 at 08:26
I am also facing the same problem. I am using rails 2.3.2. I have added the ActiveSupport::Inflector, but still problem has not solved.
Please give me some idea
Nishita at 05 May 09 at 06:02
This sounds like the same problem that I am having too but I’m not sure. I’m using rails 2.3.2 and file_column. This occurred after I moved my application (and ruby install) from Windows to Ubuntu Linux 8.0.4.
The error message that I am getting is: ActionView::TemplateError (uninitialized constant FileColumn::ClassMethods::Inflector)
So I’ve gone ahead and added 1) require ‘active_support/inflector’ to the top of file_column.rb 2) Replaced “Inflector” with “ActiveSupport::Inflector” also in file_column.rb
But I’m still getting the same error even after restarting the ruby.
Tim Murry at 30 Jun 09 at 20:32
Ahh, it seems with the latest version of Ruby the file_column plugin is stored in a new directory called “rails_file_column”. So for some reason I had two installations and was making the changes to the wrong one. So the solutions you suggested worked for me after all.
Tim Murry at 30 Jun 09 at 22:56
Thanks! 1 startup error gone, many to go… :-)
Rob Halff at 25 Aug 09 at 16:35
There are good reasons that Google listed this as first hit for my search:
load_missing_constant inflector
Your post solved my issue within seconds. Thanks!
Anton at 08 Nov 09 at 12:19
Articles Archive →
Got something to say?