I'm trying to run on a new computer some ruby code and I receive the following error (rails db:migrate --trace)
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
rails aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/Users/jairochavez/Documents/Rails/rfdf_bolivia/config/initializers/stripe.rb:2:in `<main>'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:657:in `block in load_config_initializer'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in `instrument'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:656:in `load_config_initializer'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:613:in `each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/engine.rb:613:in `block in <class:Engine>'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `tsort_each_child'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:415:in `call'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:415:in `each_strongly_connected_component_from'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `call'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!'
/Users/jairochavez/Documents/Rails/rfdf_bolivia/config/environment.rb:5:in `<main>'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:337:in `require_environment!'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/application.rb:520:in `block in run_tasks_blocks'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:238:in `block in invoke_prerequisites'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `invoke_prerequisites'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:238:in `block in invoke_prerequisites'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `invoke_prerequisites'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<main>'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
/Users/jairochavez/Documents/Rails/rfdf_bolivia/bin/rails:9:in `<top (required)>'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/jairochavez/.rbenv/versions/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/jairochavez/Documents/Rails/rfdf_bolivia/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
config/initializers/stripe.rb
Rails.configuration.stripe = {
publishable_key: Rails.application.credentials[Rails.env.to_sym][:stripe][:public_key],
secret_key: Rails.application.credentials[Rails.env.to_sym][:stripe][:secret_key]
}
Stripe.api_key = Rails.configuration.stripe[:secret_key]
From the stacktrace you posted, this line in particular appears to be the issue:
Rails.application.credentials[Rails.env.to_sym][:stripe][:public_key]
Since you're chaining multiple hash accesses, one of those objects is nil. You could try inspecting each of them by adding something like this to the top of the initializer:
puts Rails.application.credentials.inspect
puts Rails.application.credentials[Rails.env.to_sym].inspect
puts Rails.application.credentials[Rails.env.to_sym][:stripe].inspect
That will tell you which part is nil that shouldn't be, and you can update your credentials file accordingly.
Based on your configuration you should have your credentials.yml looking something like this:
stripe:
secret_key: pk_123456789012345
public_key: sk_abcdefghijklnmk
In your stripe.rb you missed [:secret_key]. It should look like this. But this won't work either when you are precompiling in production.
Stripe.api_key = Rails.application.credentials[Rails.env.to_sym][:stripe][:secret_key]
Use dig method instead.
So for your stripe.rb
Stripe.api_key = Rails.application.credentials.dig(:stripe, :secret_key)
In your terminal run
RAILS_ENV=production rails c
In the console run
Rails.application.credentials.dig(:stripe, :secret_key)
Now you should get a value.
This was an issue I ran into and suffered until I figure it out. It seems to be an issue with rails code base. Not sure we need to load credentials to compile assets. Anyways, they close this issue but I am not sure why they closed it. Here is the link to the issue. https://github.com/rails/rails/issues/32947
When cloning an existing repo, you might run into this error if you do not have a config/master.key file, (which is not checked in to source control, e.g. GitHub). This is because, as #Elias Glyptis pointed out, credentials are needed to compile assets, (as documented in Rails #32947).
config/initializer/stripe.rb
Stripe.api_key = Rails.application.credentials.dig(Rails.env.to_sym, :stripe, :secret)
I'm trying to create a new Rails 6 app on Windows 10 machine. However, when I try to run anything rails or rake commands, it hangs/freezes. I discovered that it was tied to Webpacker when I was creating my DB.
C:\Sites\myapp> bundle exec rake db:migrate --trace
When I terminated the job, it showed this:
rails aborted!
Interrupt:
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/railtie.rb:33:in ``'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/webpacker-4.0.7/lib/webpacker/railtie.rb:33:in `block in <class:Engine>'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/initializable.rb:32:in `instance_exec'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/initializable.rb:32:in `run'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/initializable.rb:61:in `block in run_initializers'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:347:in `each'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:347:in `call'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
C:/tools/ruby26/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/initializable.rb:60:in `run_initializers'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/application.rb:362:in `initialize!'
C:/Sites/highbar/config/environment.rb:5:in `<top (required)>'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/zeitwerk-2.1.6/lib/zeitwerk/kernel.rb:23:in `require'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/zeitwerk-2.1.6/lib/zeitwerk/kernel.rb:23:in `require'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:302:in `block in require'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:268:in `load_dependency'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0.rc1/lib/active_support/dependencies.rb:302:in `require'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/application.rb:338:in `require_environment!'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/application.rb:514:in `block in run_tasks_blocks'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
C:/tools/ruby26/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:238:in `block in invoke_prerequisites'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `each'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `invoke_prerequisites'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
C:/tools/ruby26/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:238:in `block in invoke_prerequisites'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `each'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `invoke_prerequisites'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
C:/tools/ruby26/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands/rake/rake_command.rb:20:in `perform'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/command.rb:48:in `invoke'
C:/tools/ruby26/lib/ruby/gems/2.6.0/gems/railties-6.0.0.rc1/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:create => db:load_config => environment
When I comment out Webpacker in the gemfile, this worked, as did rails s. As soon as I uncomment Webpacker, the commands freeze/hang again.
Is there anything that I need to do beyond bundle exec rails webpacker:install?
My version of NodeJS was out of date. When I updated NodeJS, I also needed to update Yarn. After doing that, I'm able to run Rails 6 with Webpacker.
I'm new to programming and am building a simple wiki sharing app in Ruby on Rails. Every time I try to run rake db:drop, I get this stack trace:
Text file busy - /home/vagrant/code/blocipedia/db/development.sqlite3
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:1433:in `unlink'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:1433:in `block in remove_file'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:1438:in `platform_support'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:1432:in `remove_file'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:785:in `remove_file'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:563:in `block in rm'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:562:in `each'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/fileutils.rb:562:in `rm'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/sqlite_database_tasks.rb:22:in `drop'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:98:in `drop'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:110:in `block in drop_current'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:183:in `block in each_current_configuration'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:182:in `each'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:182:in `each_current_configuration'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/tasks/database_tasks.rb:109:in `drop_current'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/activerecord-4.0.10/lib/active_record/railties/databases.rake:35:in `block (2 levels) in <top (required)>'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/vagrant/.rvm/rubies/ruby-2.0.0-p576/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/bin/rake:23:in `load'
/home/vagrant/.rvm/gems/ruby-2.0.0-p576/bin/rake:23:in `<main>'
Couldn't drop db/development.sqlite3
any ideas on how to fix this? I've tried running rake db:migrate first, but still end up with the same problem.
after pushing my latest code Heroku doesn't alter the tables.
when i run "heroku rake db:migrate" i get rake aborted!
its says syntax error but i cant figure where is the error
syntax error on line 4, col 586: ` state: ["σלקµ╡╖Θבף","Θ¥עµú«τ£ל","σ▓⌐µיכτ£ל","σ««σƒמτ£ל","τºכτפ░τ£ל","σ▒▒σ╜óτ£ל","τªןσ│╢τ£ל","Φל¿σƒמτ£ל","µáדµ£¿τ£ל","τ╛ñΘª¼τ£ל","σƒ╝τמיτ£ל","σםדΦסיτ£ל","µ¥▒Σ║¼Θד╜","τÑ₧σÑטσ╖¥τ£ל","µצ░µ╜ƒτ£ל","σ»לσ▒▒τ£ל","τƒ│σ╖¥τ£ל","τªןΣ║ץτ£ל","σ▒▒µó¿τ£ל","Θץ╖Θחמτ£ל","σ▓נΘר£τ£ל","Θ¥שσ▓íτ£ל","µה¢τƒÑτ£ל","Σ╕יΘחםτ£ל","µ╗כΦ│אτ£ל","Σ║¼Θד╜σ║£","σñºΘר¬σ║£","σו╡σ║½τ£ל","σÑטΦי»τ£ל","σעלµ¡לσ▒▒τ£ל","Θ│Ñσןצτ£ל","σ│╢µá╣τ£ל","σ▓íσ▒▒τ£ל","σ║דσ│╢τ£ל","σ▒▒σןúτ£ל","σ╛│σ│╢τ£ל","Θªשσ╖¥τ£ל","µה¢σ¬¢τ£ל","Θ½רτƒÑτ£ל","τªןσ▓íτ£ל","Σ╜נΦ│אτ£ל","Θץ╖σ┤מτ£ל","τזךµ£¼τ£ל","σñºσטזτ£ל","σ««σ┤מτ£ל","Θ╣┐σונσ│╢τ£ל","µ▓צτ╕הτ£ל"]'
/usr/local/lib/ruby/1.9.1/syck.rb:135:in `load'
/usr/local/lib/ruby/1.9.1/syck.rb:135:in `load'
/usr/local/lib/ruby/1.9.1/syck.rb:146:in `block in load_file'
/usr/local/lib/ruby/1.9.1/syck.rb:145:in `open'
/usr/local/lib/ruby/1.9.1/syck.rb:145:in `load_file'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/base.rb:172:in `load_yml'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/base.rb:157:in `load_file'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/base.rb:15:in `block in load_translations'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/base.rb:15:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/base.rb:15:in `load_translations'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/simple.rb:57:in `init_translations'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/simple.rb:71:in `lookup'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/base.rb:26:in `translate'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/fallbacks.rb:44:in `block (2 levels) in translate'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/fallbacks.rb:43:in `catch'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/fallbacks.rb:43:in `block in translate'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/fallbacks.rb:42:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/fallbacks.rb:42:in `translate'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n.rb:156:in `block in translate'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n.rb:152:in `catch'
/app/vendor/bundle/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n.rb:152:in `translate'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/railtie.rb:102:in `block in <class:Railtie>'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:34:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:83:in `require_environment!'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:193:in `block (2 levels) in initialize_tasks'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `load'
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `<main>'
Tasks: TOP => db:version => environment
any ideas what is the problem?
I just ran into the exact same situation
/usr/local/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 4, col 586:
syntax error on line 4, col 586: ` state: ["北海道","青森県","岩手県","宮城県","秋田県","山形県","福島県","茨城県","栃木県","群馬県","埼玉県","千葉県","東京都","神奈川県","新潟県","富山県","石川県","福井県","山梨県","長野県","岐阜県","静岡県","愛知県","三重県","滋賀県","京都府","大阪府","兵庫県","奈良県","和歌山県","鳥取県","島根県","岡山県","広島県","山口県","徳島県","香川県","愛媛県","高知県","福岡県","佐賀県","長崎県","熊本県","大分県","宮崎県","鹿児島県","沖縄県"]'
some of my local /tmp/asset binaries matched the grep statement. I ran "heroku run grep -R "state:" *" and found that the file "vendor/bundle/ruby/1.9.1/gems/faker-1.1.0/lib/locales/ja.yml" matched my problem line. Works fine on my end, but apparently the Faker gem has a problem on Heroku's.
I use ruby 1.9.2 and rake 0.9.2.2 on Ubuntu.
When I want to
rake db:migrate
I get the following error message
rake aborted!
couldn't parse YAML at line 89 column 16
/usr/local/rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:148:in `parse'
/usr/local/rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'
/usr/local/rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:119:in `parse'
/usr/local/rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:106:in `load'
/usr/local/rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/psych.rb:205:in `load_file'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n/backend/base.rb:171:in `load_yml'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n/backend/base.rb:157:in `load_file'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `block in load_translations'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n/backend/base.rb:15:in `load_translations'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n/backend/simple.rb:57:in `init_translations'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n/backend/simple.rb:71:in `lookup'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n/backend/base.rb:26:in `translate'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n.rb:156:in `block in translate'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n.rb:152:in `catch'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/i18n-0.6.0/lib/i18n.rb:152:in `translate'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activerecord-3.1.3/lib/active_record/railtie.rb:102:in `block in <class:Railtie>'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:34:in `call'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/ralv/devapp/config/environment.rb:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/application.rb:83:in `require_environment!'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/railties-3.1.3/lib/rails/application.rb:193:in `block (2 levels) in initialize_tasks'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/rvm/gems/ruby-1.9.2-p318/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p318/bin/rake:19:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p318/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment
I can solve the problem by commenting out the 89th line of my locale file:
open_tasks: %{total} (%{count} offen)
But it's quite annoying to do this everytime I want to migrate the database...
The problem seems to be the blank character in front of the first percent sign. If I change the line to
open_tasks: (%{total} (%{count} offen)
I can migrate without an abortion.
How can I avoid this parser error?
Thanks
Christian
You can use quotes for complex values
open_tasks: "%{total} (%{count} offen)"