前提・実現したいこと
modelを作成したい
発生している問題・エラーメッセージ
railsでmodelを作成しようとしたら、エラーが発生しました。
エラーメッセージ /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/connection_specification.rb:176:in `rescue in spec': Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError) from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/connection_specification.rb:173:in `spec' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:53:in `establish_connection' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activerecord-5.0.7.2/lib/active_record/railtie.rb:125:in `block (2 levels) in <class:Railtie>' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:49:in `each' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activerecord-5.0.7.2/lib/active_record/base.rb:324:in `<module:ActiveRecord>' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activerecord-5.0.7.2/lib/active_record/base.rb:24:in `<top (required)>' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `block in require' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:259:in `load_dependency' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/activesupport-5.0.7.2/lib/active_support/dependencies.rb:293:in `require' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:376:in `active_record_configured?' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:293:in `disconnect_database' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:111:in `preload' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:139:in `run' from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>' from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' from -e:1:in `<main>'
試したこと
gem 'sqlite3' を gem "sqlite3", "~> 1.3.6"に変更しました。
自分なりに調べて色々と試してみましたが、エラーの連続で心が折れそうになったので質問してみました。
プログラミング自体初心者でよくわかっていない為、質問内容等分かりずらいところがあるかと思いますが、どなたかお力添え頂けると助かります。
よろしくお願いします。
補足情報(FW/ツールのバージョンなど)
macOS 11.0.1
Google Chrome バージョン: 89.0.4389.90
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
Rails 5.0.7.2
sqlite3 --version
3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/05/12 15:30
2021/05/12 15:56 編集
2021/05/12 16:09
2021/05/12 16:35
2021/05/13 10:05