开发者

Anyone having issues syncing/importing existing data during initial configuration of tolk

I'm trying to setup tolk source: http://github.com/dhh/tolk

I'm at the point where I'm running:

$ rake tolk:sync

and

$ rake tolk:import
开发者_运维技巧

but neither will work. I get the following error

~/Rails/appname: rake tolk:sync --trace
(in /Users/username/Rails/appname)
** Invoke tolk:sync (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute tolk:sync
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.each
/Users/username/Rails/appname/vendor/plugins/tolk/lib/tolk/sync.rb:24:in `flat_hash'
/Users/username/Rails/appname/vendor/plugins/tolk/lib/tolk/sync.rb:14:in `load_translations'
/Users/username/Rails/appname/vendor/plugins/tolk/lib/tolk/sync.rb:9:in `sync!'
/Users/username/Rails/appname/vendor/plugins/tolk/tasks/tolk_tasks.rake:4
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

I have a partially populated en, fr, and another misc locale file but it won't seem to import or sync. Any suggestions would be appreciated.


Prior tutorial had me creating a default locale of 'pt' corrected it:

in config/initializer/locale.rb

tell the I18n library where to find your translations

I18n.load_path += Dir[ File.join(RAILS_ROOT, 'lib', 'locale', '*.{rb,yml}') ]

you can omit this if you're happy with English as a default locale

I18n.default_locale = "pt-BR" #changed to 'en'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜