Forum: Rails I18n Problem freezing svenfuchs-i18n gem

73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 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
390e714e320bd505fb5e9f762870ba5e?d=identicon&s=25 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>:
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 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
402602a60e500e85f2f5dc1ff3648ecb?d=identicon&s=25 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
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 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.
This topic is locked and can not be replied to.