Luk*_*ell 2 postgresql ruby-on-rails heroku rails-console
我一直在关注Rails应用程序的教程。本教程基于Rails 5,我正在使用Rails 5.1.2。一切都在本地运行良好,并毫无问题地推送至heroku。但是,当我通过运行在生产数据库上创建管理员用户时:
$ heroku run rails c
Run Code Online (Sandbox Code Playgroud)
它返回以下错误:
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.3/lib/active_support/dependencies.rb:292:
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在/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:inrequire'来自/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler.rb :74:try_require' from /app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/handler.rb:16:in从/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/server.rb 中获取:301 :在server' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:68:inprint_boot_information中从/ app / vendor / bundle / ruby /2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:38:start' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:131:in在/app/vendor/bundle/ruby/2.4.0/gems/railties- 5.1.3 / lib / rails / commands / server / server_command.rb:126:tap' from /app/vendor/bundle/ruby/2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in从/app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/command.rb执行:27: 在run' from /app/vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in来自/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:inperform'来自/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'从斌/导轨:9:require' from bin/rails:9:in'`
为了解决这个问题,我可以运行:
$ heroku run bash
$ rails c
Run Code Online (Sandbox Code Playgroud)
这使我可以更新生产数据库。虽然这可行,并且可以满足我的需求。我想知道为什么原始命令不起作用。我到处都在寻找答案,无法找到适用于我的任何内容。我正在尝试提高自己的开发技能,并且想了解为什么原始问题无法解决。
我可以添加任何人需要查看的文件,但是我什至不知道哪个文件与该问题有关。
| 归档时间: |
|
| 查看次数: |
1702 次 |
| 最近记录: |