为什么“heroku console”与 Padrino 给出无用的错误消息?
使用 Heroku 控制台时,当引发异常时,我总是会收到“内部服务器错误”,而不是像我预期的那样出现堆栈跟踪。
以下是我的意思的抄本:
$ heroku console
Ruby console for myapp.heroku.com
>> var_that_does_not_exist
! Internal server error
>>
$ heroku run bundle exec padrino console -e production
Running bundle exec padrino console -e production attached to terminal... up, run.9
=> Loading production console (Padrino v.0.10.1)
=> Loading Application MyApp
=> Loading Application Admin
irb(main):001:0> var_that_does_not_exist
NameError: undefined local variable or method `var_that_does_not_exist' for main:Object
from (irb):1
irb(main):002:0>
关于我可以更改哪些内容来获取堆栈跟踪的任何想法?
When using heroku console
, I always get "Internal server error" when an exception is raised rather than a stacktrace as I would expect.
Here's a transcript of what I mean:
$ heroku console
Ruby console for myapp.heroku.com
>> var_that_does_not_exist
! Internal server error
>>
$ heroku run bundle exec padrino console -e production
Running bundle exec padrino console -e production attached to terminal... up, run.9
=> Loading production console (Padrino v.0.10.1)
=> Loading Application MyApp
=> Loading Application Admin
irb(main):001:0> var_that_does_not_exist
NameError: undefined local variable or method `var_that_does_not_exist' for main:Object
from (irb):1
irb(main):002:0>
Any ideas on what I can change to get the stack traces?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这已在最新版本的 Heroku gem 中得到修复。运行
heroku update
应该可以解决此问题。This has been fixed in the latest version of the Heroku gem. Running
heroku update
should resolve this issue.heroku console
已被弃用。您应该使用heroku run ...
来代替。根据您的 Rails 版本,以下操作之一应该有效:$ heroku run script/console
$ Heroku Run Bundle 执行 Rails 控制台
heroku console
has been deprecated. You should useheroku run …
instead. Depending on your rails version, one of the following should work:$ heroku run script/console
$ heroku run bundle exec rails console