0

I'm building a new Rails application that's using the i18n-tasks gem, but when I run the command i18n-tasks this output is shown:

/home/user-pc/.rvm/gems/ruby-1.9.3-p392@product/gems/i18n-tasks-0.5.1/lib/i18n/tasks/plural_keys.rb:3:in `<module:PluralKeys>': uninitialized constant I18n::Tasks::PluralKeys::Set (NameError)
    from /home/user-pc/.rvm/gems/ruby-1.9.3-p392@product/gems/i18n-tasks-0.5.1/lib/i18n/tasks/plural_keys.rb:2:in `<top (required)>'
    from /home/user-pc/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/user-pc/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/user-pc/.rvm/gems/ruby-1.9.3-p392@product/gems/i18n-tasks-0.5.1/lib/i18n/tasks/base_task.rb:5:in `<top (required)>'
    from /home/user-pc/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/user-pc/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/user-pc/.rvm/gems/ruby-1.9.3-p392@product/gems/i18n-tasks-0.5.1/lib/i18n/tasks.rb:20:in `<top (required)>'
    from /home/user-pc/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/user-pc/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/user-pc/.rvm/gems/ruby-1.9.3-p392@product/gems/i18n-tasks-0.5.1/bin/i18n-tasks:4:in `<top (required)>'
    from /home/user-pc/.rvm/gems/ruby-1.9.3-p392@product/bin/i18n-tasks:23:in `load'
    from /home/user-pc/.rvm/gems/ruby-1.9.3-p392@product/bin/i18n-tasks:23:in `<main>'

What's the main problem? Why can't I run these commands as in README file?

glebm
  • 20,282
  • 8
  • 51
  • 67
enrique-carbonell
  • 5,836
  • 3
  • 30
  • 44

1 Answers1

2

The main problem was with how to run the i18n-tasks command. The Readme file says that I can execute:

i18n-tasks

But the command executed directly fails for me. To work properly, the command needs to run as:

bundle exec i18n-tasks

This was all.

glebm
  • 20,282
  • 8
  • 51
  • 67
enrique-carbonell
  • 5,836
  • 3
  • 30
  • 44
  • I find that when the __i18n gem__ is installed through bundler by defining it in the `Gemfile`, then I need to run `bundle exec i18n-tasks` for any task. If I want to run `i18n-tasks` directly then I have to also install the gem from the command line, `gem install i18n-tasks`. Now I can use it directly without going through `bundler exec`. – JohnRDOrazio Jun 29 '21 at 09:35