【问题标题】:Rails Server producing error on Home Page after rails 5 upgradeRails 5 升级后,Rails 服务器在主页上产生错误
【发布时间】:2017-02-26 07:02:06
【问题描述】:

我已尝试从 rails 4.2 升级到 5。我的 ruby​​ 版本和 rails 版本现在都已升级,并且我尝试执行我认为的大部分升级步骤。当我运行 rails server 时,服务器会启动,但是当我访问 localhost:3000 时,浏览器会抛出错误。

奇怪的是终端/日志根本没有抛出任何错误。我在日志中看到了这一点:

iMac:appDirectory name$ rails server
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from block in <top (required)> at /Users//.rvm/gems/ruby-2.4.0@global/gems/gretel-3.0.8/lib/gretel/deprecated/default_style_key.rb:10)
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from block in <top (required)> at /Users//.rvm/gems/ruby-2.4.0@global/gems/gretel-3.0.8/lib/gretel/deprecated/show_root_alone.rb:11)
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from block in <top (required)> at /Users//.rvm/gems/ruby-2.4.0@global/gems/gretel-3.0.8/lib/gretel/deprecated/yield_links.rb:19)
DEPRECATION WARNING: Accessing mime types via constants is deprecated. Please change `Mime::HTML` to `Mime[:html]`. (called from <class:Request> at /Users//.rvm/gems/ruby-2.4.0@global/gems/web-console-2.2.1/lib/web_console/request.rb:7)
DEPRECATION WARNING: Accessing mime types via constants is deprecated. Please change `Mime::TEXT` to `Mime[:text]`. (called from <class:Request> at /Users//.rvm/gems/ruby-2.4.0@global/gems/web-console-2.2.1/lib/web_console/request.rb:7)
DEPRECATION WARNING: Accessing mime types via constants is deprecated. Please change `Mime::URL_ENCODED_FORM` to `Mime[:url_encoded_form]`. (called from <class:Request> at /Users//.rvm/gems/ruby-2.4.0@global/gems/web-console-2.2.1/lib/web_console/request.rb:7)
=> Booting WEBrick
=> Rails 5.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
[2017-02-26 00:51:50] INFO  WEBrick 1.3.1
[2017-02-26 00:51:50] INFO  ruby 2.4.0 (2016-12-24) [x86_64-darwin15]
[2017-02-26 00:51:50] INFO  WEBrick::HTTPServer#start: pid=xxxxx port=3000
Started GET "/" for ::1 at 2017-02-26 00:51:57 -0600

我相信这可能只是我忘记的一些愚蠢的事情(与 rails 5 升级完全无关)但我有点难过,因为即使 localhost:3000 抛出,我也看不到任何错误消息:

We're sorry, but something went wrong.

If you are the application owner check the logs for more information.

感谢您的帮助...

【问题讨论】:

  • 显示logs/development.log
  • 您的应用中是否有“web-console”gem?如果您有该宝石,请更新该宝石。我想这会解决问题。
  • 是的,Shabini 做到了 - 非常感谢。

标签: ruby-on-rails ruby-on-rails-5 rails-upgrade


【解决方案1】:

按照 Shabini 的评论更新 web-console gem 就可以了。

【讨论】:

    猜你喜欢
    • 2015-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-08
    • 1970-01-01
    • 1970-01-01
    • 2022-01-15
    • 1970-01-01
    相关资源
    最近更新 更多