質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
Cloud9

Cloud9は、クラウドからのプログラミングが可能になるWebサービス。IDEとしての機能が搭載されており、GitHubやHerokuなど他ツールとの連携も可能です。ブラウザ上で動くため、デバイスに関係なく開発環境を準備できます。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

519閲覧

railsのNoMethodErrorが解決できない

fresh_fish

総合スコア20

Cloud9

Cloud9は、クラウドからのプログラミングが可能になるWebサービス。IDEとしての機能が搭載されており、GitHubやHerokuなど他ツールとの連携も可能です。ブラウザ上で動くため、デバイスに関係なく開発環境を準備できます。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2020/06/28 11:41

編集2020/06/28 12:29

前提・実現したいこと

railsチュートリアルを進めている途中
$ rails generate controller StaticPages home help
でNomethoderrorが起きてしまいます

発生している問題・エラーメッセージ

/home/ubuntu/environment/sample_app/config/environments/development.rb:63:in `block in <main>': undefined method `config' for ActiveSupport::EventedFileUpdateChecker:Class Did you mean? concerning (NoMethodError) from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/railtie.rb:216:in `instance_eval' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/railtie.rb:216:in `configure' from /home/ubuntu/environment/sample_app/config/environments/development.rb:1:in `<main>' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/engine.rb:613:in `block (2 levels) in <class:Engine>' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/engine.rb:612:in `each' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/engine.rb:612:in `block in <class:Engine>' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/initializable.rb:32:in `instance_exec' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/initializable.rb:32:in `run' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/initializable.rb:61:in `block in run_initializers' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:421:in `block in each_strongly_connected_component_from' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/initializable.rb:50:in `each' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/initializable.rb:50:in `tsort_each_child' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:in `call' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:415:in `each_strongly_connected_component_from' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `each' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `call' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/initializable.rb:60:in `run_initializers' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-6.0.3/lib/rails/application.rb:363:in `initialize!' from /home/ubuntu/environment/sample_app/config/environment.rb:5:in `<main>' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `block in require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:291:in `load_dependency' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/dependencies.rb:324:in `require' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:106:in `preload' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `run' from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' from -e:1:in `<main>'

該当のソースコード

development.rb

1Railsdeve.application.configure do 2 # Settings specified here will take precedence over those in config/application.rb. 3 4 # In the development environment your application's code is reloaded on 5 # every request. This slows down response time but is perfect for development 6 # since you don't have to restart the web server when you make code changes. 7 config.cache_classes = false 8 9 # Do not eager load code on boot. 10 config.eager_load = false 11 12 # Show full error reports. 13 config.consider_all_requests_local = true 14 15 # Enable/disable caching. By default caching is disabled. 16 # Run rails dev:cache to toggle caching. 17 if Rails.root.join('tmp', 'caching-dev.txt').exist? 18 config.action_controller.perform_caching = true 19 config.action_controller.enable_fragment_cache_logging = true 20 21 config.cache_store = :memory_store 22 config.public_file_server.headers = { 23 'Cache-Control' => "public, max-age=#{2.days.to_i}" 24 } 25 else 26 config.action_controller.perform_caching = false 27 28 config.cache_store = :null_store 29 end 30 31 # Store uploaded files on the local file system (see config/storage.yml for options). 32 config.active_storage.service = :local 33 34 # Don't care if the mailer can't send. 35 config.action_mailer.raise_delivery_errors = false 36 37 config.action_mailer.perform_caching = false 38 39 # Print deprecation notices to the Rails logger. 40 config.active_support.deprecation = :log 41 42 # Raise an error on page load if there are pending migrations. 43 config.active_record.migration_error = :page_load 44 45 # Highlight code that triggered database queries in logs. 46 config.active_record.verbose_query_logs = true 47 48 # Debug mode disables concatenation and preprocessing of assets. 49 # This option may cause significant delays in view rendering with a large 50 # number of complex assets. 51 config.assets.debug = true 52 53 # Suppress logger output for asset requests. 54 config.assets.quiet = true 55 56 # Raises error for missing translations. 57 # config.action_view.raise_on_missing_translations = true 58 59 # Use an evented file watcher to asynchronously detect changes in source code, 60 # routes, locales, etc. This feature depends on the listen gem. 61 config.file_watcher = ActiveSupport::EventedFileUpdateChecker. 62 # Cloud9 への接続を許可する 63 config.hosts.clear 64end 65

試したこと

railsチュートリアルをコピペしているので記述ミスはないはずです
gemfileの設定かgem自体の中身がおかしいと思っているのですがcloud9にて上位ディレクトリの開き方がわからない為(ファイルツリーには/home/ubunts/environment/以降しか表示されない)確認もできず困っております

他に必要な情報があれば教えていただけると助かります

補足情報(FW/ツールのバージョンなど)

cloud9 rails6.0.3 ruby2.6.3
ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

config.file_watcher = ActiveSupport::EventedFileUpdateChecker.

最後の.が不要です。

投稿2020/06/28 12:31

asm

総合スコア15147

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

fresh_fish

2020/06/28 12:36

そこだったとは思いませんでした。。。 助かりましたありがとうございました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問