前提・実現したいこと
ここに質問の内容を詳しく書いてください。
Ruby on railsにてチャットルームアプリを作成しようとしています。
まだそこまでたどり着いていないですが、初回のcontrollerを作成しようとしているところです。
発生している問題・エラーメッセージ
rails g controller groupsを実行した際、下記のようなエラーが出てファイルが作成されませんでした。
$MacBook-Air:chat-space $ rails g controller groups /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:92:in `require': /Users/okakaori/projects/chat-space/config/application.rb:17: syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError) from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:92:in `preload' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' from -e:1:in `<main>'
試したこと
・gemのバージョンについてのことが書かれているかと思ったので、bundl updateしましたが結果は変わりませんでした
・エラー個所を確認しようとしてパスを辿ったのですが、隠しファイルなのでどのように見るかわからなかった。
↓ご回答内容から下記のようなことを行いました
ruby
1#config/application.rb 2module ChatSpace 3 class Application < Rails::Application 4 config.generators do |g| 5 g.stylesheets false 6 g.javascripts false 7 g.helper false 8 g.test_framework false 9 end 10end
このような記述があったので、classのエンドを足しました。
そして再度rails g hoge 行ったのですが、さらに多くの似たようなエラーが表示されました。
長くて申し訳ない。下記です。
/Users/okakaori/projects/chat-space/config/initializers/new_framework_defaults.rb:23:in `<top (required)>': undefined method `halt_callback_chains_on_return_false=' for ActiveSupport:Module (NoMethodError) from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `block in load' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:285:in `load' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:657:in `block in load_config_initializer' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in `instrument' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:656:in `load_config_initializer' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:614:in `block (2 levels) in <class:Engine>' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:613:in `each' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/engine.rb:613:in `block in <class:Engine>' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `instance_exec' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:32:in `run' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:61:in `block in run_initializers' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:421:in `block in each_strongly_connected_component_from' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `each' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:50:in `tsort_each_child' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:415:in `call' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:415:in `each_strongly_connected_component_from' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `call' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/initializable.rb:60:in `run_initializers' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/application.rb:361:in `initialize!' from /Users/okakaori/projects/chat-space/config/environment.rb:5:in `<top (required)>' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:106:in `preload' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' from /Users/okakaori/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/03 11:07 編集
2019/10/03 06:13
2019/10/03 06:23
2019/10/03 11:21