我一直在跟着一個Rails應用程序的教程。本教程基於Rails 5,我正在使用Rails 5.1.2。一切都在本地很好,並推向英雄沒有問題。然而,當我去運行,以創建生產數據庫管理員用戶:如何在Heroku中運行rails控制檯? Rails 5.1和postgresql
3210它返回以下錯誤:
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in
require': cannot load such file -- rack/handler/c (LoadError) from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in
block in require' from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:258:inload_dependency' from /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:in
require' from /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler.rb:74:intry_require' from /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler.rb:16:in
get' from /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/server.rb:301:inserver' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:68:in
print_boot_information' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:38:instart' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:131:in
block in perform' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:intap' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in
perform' from /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:inrun' from /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in
invoke_command' from /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:indispatch' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/command/base.rb:63:in
perform' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/command.rb:44:ininvoke' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands.rb:16:in
' from bin/rails:9:inrequire' from bin/rails:9:in
'`
爲了解決這個問題,我可以運行:
$ heroku run bash
$ rails c
這使我可以更新生產數據庫。雖然這工作,並得到我所需要的。我想知道爲什麼原始命令不起作用。我到處尋找答案,不能拿出任何適用於我的東西。我正在努力提高自己的開發技能,並希望理解爲什麼原始問題不起作用。
我可以添加任何人需要查看的文件,但我甚至不知道哪個文件與這個問題有關。
你張貼整個錯誤消息? –
https://devcenter.heroku.com/articles/getting-started-with-rails5#rails-console指出'heroku run rails console'是在heroku上訪問您的rails控制檯的正確命令。根據其他stackoverflow文章,這可能是缺少的寶石或環境參數,找不到。 –