Rails rails 5 升级后服务器在主页上产生错误
Rails Server producing error on Home Page after rails 5 upgrade
我尝试从 rails 4.2 升级到 5。我的 ruby 版本和 rails 版本现在都升级了,我尝试 运行通过我认为大部分的升级步骤。当我 运行 rails 服务器时,服务器会启动,但是当我访问 localhost:3000 时,浏览器会抛出错误。
奇怪的是 terminal/log 根本没有抛出任何错误。我在日志中看到了这个:
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.
感谢您的帮助...
根据 Shabini 的评论更新网络控制台 gem 成功了。
我尝试从 rails 4.2 升级到 5。我的 ruby 版本和 rails 版本现在都升级了,我尝试 运行通过我认为大部分的升级步骤。当我 运行 rails 服务器时,服务器会启动,但是当我访问 localhost:3000 时,浏览器会抛出错误。
奇怪的是 terminal/log 根本没有抛出任何错误。我在日志中看到了这个:
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.
感谢您的帮助...
根据 Shabini 的评论更新网络控制台 gem 成功了。