###質問
Ruby on Railsを勉強中です。初めての質問です。よろしくお願いします。
「Ruby on Rails チュートリアル」3.1セットアップのところで
「hello, world!」に「helloこんにちは!, world!みなさん!」と2バイト文字を追加したら、下記のエラーが出ました。
rails We're sorry, but something went wrong.
なお、「Ruby on Rails チュートリアル」3.1セットアップを完了し、ローカルでRailsサーバを起動し、「hello, world!」が表示されることを確認しています。
何をどうしたらいいか、教えてください。
###ログの状況
ログをみると、以下のログが出力されていますが、エラーは出ていません。
Started GET "/" for ::1 at 2017-03-31 11:31:51 +0900
ちなみに、「hello, world!」に戻した時のログは以下のようになっていて、renderingが成功しています。
Started GET "/" for ::1 at 2017-03-31 11:34:21 +0900
Processing by ApplicationController#hello as HTML
Rendering html template
Rendered html template (0.0ms)
Completed 200 OK in 46ms (Views: 25.9ms | ActiveRecord: 0.0ms)
###該当のソースコード
下のコードは" # "を" * "に置き換えています。
Rails.application.routes.draw do
- For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root 'application#hello'
end
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
def hello
- render html: "hello, こんにちは!!世界world!"
render html: "hello, world!"
end
end
###開発環境:
-
Ruby version
ruby 2.2.6p396 (2016-11-15 revision 56800) [i386-mingw32] -
System dependencies
Rails 5.0.0.1
puma (3.4.0)
sqlite3 (1.3.11)
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/04/05 01:11 編集
2017/04/05 01:33 編集