ActiveSupport not including i18n?

28 views
Skip to first unread message

John Hinnegan

unread,
Jul 22, 2011, 3:09:53 PM7/22/11
to rubyonra...@googlegroups.com
Went to use ActiveSupport in a gem today and got an error on account of not having i18n installed.  Either bundler should be installing i18n along with activesupport or docs need to be updated.

bundle exec irb
require 'active_support/all'


detailed steps and error:

1) add to Gemfile
require 'activesupport'

2) try it out
bundle exec irb
require 'active_support/core_ext'
You don't have i18n installed in your application. Please add it to your Gemfile and run bundle install
LoadError: no such file to load -- i18n
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/i18n.rb:2:in `require'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/i18n.rb:2:in `<top (required)>'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/inflector/transliterate.rb:3:in `require'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/inflector/transliterate.rb:3:in `<top (required)>'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext/string/inflections.rb:3:in `require'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext/string/inflections.rb:3:in `<top (required)>'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext/array/conversions.rb:4:in `require'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext/array/conversions.rb:4:in `<top (required)>'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext/array.rb:4:in `require'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext/array.rb:4:in `<top (required)>'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext.rb:2:in `require'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext.rb:2:in `block in <top (required)>'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext.rb:1:in `each'
        from /Users/MacbookPro/.rvm/gems/ruby-1.9.2-p0@thinknear-ruby/gems/activesupport-3.0.9/lib/active_support/core_ext.rb:1:in `<top (required)>'
        from (irb):1:in `require'
        from (irb):1
        from /Users/MacbookPro/.rvm/rubies/ruby-1.9.2-p0/bin/irb:16:in `<main>'ruby-1.9.2-p0 :002 > exit


Sure enough i18n is not installed by bundler when requiring activesupport.

Fix:  adding require i18n to my Gemfile and running the bundle install did fix the problem.

When running bundle install, I see
Using activesupport (3.0.9) 


Looked at the source, I see the dependency listed in the gemspec.  

I'm unblocked, but I'm of the opinion that I should not have needed to add i18n as a dependency of my project.  If that's not the case, then we should update the docs that say 'to use activesupport, just add "require 'activesupport'" to your Gemfile to mention the requirement for i18n


Kendall Gifford

unread,
Jul 22, 2011, 4:14:47 PM7/22/11
to rubyonra...@googlegroups.com

I'm unblocked, but I'm of the opinion that I should not have needed to add i18n as a dependency of my project.  If that's not the case, then we should update the docs that say 'to use activesupport, just add "require 'activesupport'" to your Gemfile to mention the requirement for i18n


 I agree with you here. If simply using the core extensions need i18n, then it must be dependency. Perhaps you should post this to the "Ruby on Rails: Core" mailing list: https://groups.google.com/forum/#!forum/rubyonrails-core

Reply all
Reply to author
Forward
0 new messages