LoginSignup
1
1

More than 5 years have passed since last update.

controller作成後にrails serverが動かなくなった

Posted at

controllerを作成後、rails serverコマンドが効かなくなってしまった。

$ rails s
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-07-07 23:36:29] INFO  WEBrick 1.3.1
[2015-07-07 23:36:29] INFO  ruby 2.2.1 (2015-02-26) [x86_64-darwin14]
[2015-07-07 23:36:29] INFO  WEBrick::HTTPServer#start: pid=1127 port=3000


Started GET "/static_pages/home" for ::1 at 2015-07-07 23:36:30 +0200

NoMethodError (undefined method `_view_paths' for nil:NilClass):

config/routes.rbは初期設定のままなので間違えようがないはず。

確認したところ、予約語を使っていたのが原因だった。

$ rails g controller StaticPages home class .....

Ruby and Rails Reserved Words
まぁそりゃclassは使っちゃダメだよね。凡ミスorz
しかし結構たくさんあるから気をつけなければ。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1