Forum: Rails I18n Problem freezing svenfuchs-i18n gem

Posted by Max Williams (max-williams)
on 2010-02-02 13:13
Hi all, i'm having a problem with i18n gem.

First, I froze rails into the vendor folder: that worked fine.

For i18n, i installed a gem called svenfuchs-i18n:

gem list | grep i18n
=>svenfuchs-i18n (0.2.0)

I then froze it into my vendor folder, this worked fine:
Unpacked gem:
'/home/max/work/millionaire_container/millionaire/vendor/gems/svenfuchs-i18n-0.2.0'

I reference it in my environment.rb thus:

  config.gem "svenfuchs-i18n", :version => '0.2.0'

And that's where the problem happens:  trying to load the app in the
console (just to check if the config stuff worked), i get

no such file to load -- svenfuchs-i18n
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/max/work/millionaire_container/millionaire/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in
`require'
...etc

I don't understand what i'm doing wrong here...i tried config.gem 'i18n'
but it complains that i don't have the gem.

grateful for any advice - max
Posted by Krzysztof Knapik (Guest)
on 2010-02-02 13:56
(Received via mailing list)
Probably you should have:

config.gem "svenfuchs-i18n", :version => '0.2.0', :lib => 'i18n'

but it won't help you as rails only accept gem named 'i18n', and - if
such gem exists in you gem path, Rails load its automatically,
otherwise they use bundled i18n lib.

So you don't need to specify its in your environment file and only
need installed/bundled/freezed i18n gem.

Regards,
KK

2010/2/2 Max Williams <lists@ruby-forum.com>:
Posted by Max Williams (max-williams)
on 2010-02-02 14:03
Thanks Krzysztof

I think you're right.  I took that line out of my environment.rb and 
started a console and i can still call the I18n.translate method.

cheers, max
Posted by Sven Fuchs (Guest)
on 2010-02-02 18:54
(Received via mailing list)
Also, you should be able to install from gemcutter instead of github:

http://gemcutter.org/gems/i18n
Posted by Max Williams (max-williams)
on 2010-02-02 19:03
Sven Fuchs wrote:
> Also, you should be able to install from gemcutter instead of github:
> 
> http://gemcutter.org/gems/i18n

ah, great, thanks sven.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.