1

I feel like a moron because this gem seems to be a widely used, but I can't set it up.

I'm on the i18n-js github page and I'm following the instructions:

gem install i18n-js
rake i18n:js:setup # Rails <= 3.0

And, though the gem is is now installed, I get:

Don't know how to build task 'i18n:js:setup'

Which it's actually no big surprise because I don't think it's enough to have the gem in your gemlist to add some task, right?

I also tried adding this line below, but, though the gem it's now shown as a dependency and I can access SimplesIdeias::I18n, the rake task is still not available.

# environment.rb
config.gem 'i18n-js'

What am I doing wrong?

Thanks

ecoologic
  • 10,202
  • 3
  • 62
  • 66

1 Answers1

1

Add in your Rakefile :

require 'i18n-js'
require 'i18n-js/rake'

After you have this rake task.

If you see the rake task : https://github.com/fnando/i18n-js/blob/master/lib/i18n-js/rake.rb

You can emulate this task in your console and do :

SimplesIdeias::I18n.setup!

shingara
  • 46,608
  • 11
  • 99
  • 105
  • I noticed I could have triggered it manually but I didn't want to start with the wrong foot and get into other troubles, though it's a quite simple gem. Thank you @shingara for coming to the rescue once again. – ecoologic Feb 23 '12 at 11:01
  • `require 'i18n-js'` is also needed from the task – ecoologic Feb 23 '12 at 11:34