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

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

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

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

Ruby

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

Ruby on Rails

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

Q&A

解決済

1回答

6614閲覧

railsでおこったエラーについて

退会済みユーザー

退会済みユーザー

総合スコア0

Ruby on Rails 5

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

Ruby

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

Ruby on Rails

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

0グッド

0クリップ

投稿2019/02/04 21:41

前提・実現したいこと

Cloud9でコントローラの作成を行いたいです。

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

rails new でひな形を作成し、rails g controller でコントローラの作成を行おうとしたのですが、以下のエラーが発生し、対策もわからず頭を抱えています。なにが原因なのでしょうか…

/home/ec2-user/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/bundler/rubygems_integration.rb:408:in `block (2 levels) in replace_gem': Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile. (LoadError) from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:12:in `<main>' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2/lib/active_record/connection_adapters/connection_specification.rb:191:in `spec' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:952:in `establish_connection' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2/lib/active_record/connection_handling.rb:60:in `establish_connection' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2/lib/active_record/railtie.rb:136:in `block (2 levels) in <class:Railtie>' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:51:in `each' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2/lib/active_record/base.rb:328:in `<module:ActiveRecord>' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2/lib/active_record/base.rb:27:in `<main>' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/application.rb:356:in `active_record_configured?' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/application.rb:273:in `disconnect_database' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/application.rb:107:in `preload' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/application.rb:135:in `run' from /home/ec2-user/.rvm/gems/ruby-2.5.3/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>' from /home/ec2-user/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /home/ec2-user/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require' from -e:1:in `<main>'

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

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

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

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

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

guest

回答1

0

ベストアンサー

Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile. (LoadError)

と書かれているため、Gemfileでsqliteのバージョンを指定してみてはいかがでしょうか
今回の場合は、gem 'sqlite3'gem 'sqlite3', '1.4.0'等のように書いてあると思いますが、gem 'sqlite3', '~> 1.3.6'にすると解決するかもしれません。

投稿2019/02/04 23:52

編集2019/02/05 00:05
toushimi

総合スコア117

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問