手順1
rails new address_book
手順2
cd address_book
手順3
rails g model User name:string phone:string
この手順でターミナルにコードを入力した時に以下のようなエラーが出ます。
rails g model User name:string phone:string /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activerecord-5.0.7.1/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.0/gems/activerecord-5.0.7.1/lib/active_record/connection_adapters/connection_specification.rb:173:in `spec' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activerecord-5.0.7.1/lib/active_record/connection_handling.rb:53:in `establish_connection' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activerecord-5.0.7.1/lib/active_record/railtie.rb:125:in `block (2 levels) in <class:Railtie>' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/lazy_load_hooks.rb:49:in `each' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activerecord-5.0.7.1/lib/active_record/base.rb:324:in `<module:ActiveRecord>' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activerecord-5.0.7.1/lib/active_record/base.rb:24:in `<top (required)>' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293:in `require' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293:in `block in require' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:259:in `load_dependency' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-5.0.7.1/lib/active_support/dependencies.rb:293:in `require' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/application.rb:356:in `active_record_configured?' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/application.rb:273:in `disconnect_database' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/application.rb:107:in `preload' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run' from /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>' from /home/ec2-user/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' from /home/ec2-user/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' from -e:1:in `<main>'
Gemfile
1source 'https://rubygems.org' 2 3 4# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 5gem 'rails', '~> 5.0.0' 6# Use sqlite3 as the database for Active Record 7gem 'sqlite3' 8# Use Puma as the app server 9gem 'puma', '~> 3.0' 10# Use SCSS for stylesheets 11gem 'sass-rails', '~> 5.0' 12# Use Uglifier as compressor for JavaScript assets 13gem 'uglifier', '>= 1.3.0' 14# Use CoffeeScript for .coffee assets and views 15gem 'coffee-rails', '~> 4.2' 16# See https://github.com/rails/execjs#readme for more supported runtimes 17# gem 'therubyracer', platforms: :ruby 18 19# Use jquery as the JavaScript library 20gem 'jquery-rails' 21# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 22gem 'turbolinks', '~> 5' 23# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 24gem 'jbuilder', '~> 2.5' 25# Use Redis adapter to run Action Cable in production 26# gem 'redis', '~> 3.0' 27# Use ActiveModel has_secure_password 28# gem 'bcrypt', '~> 3.1.7' 29 30# Use Capistrano for deployment 31# gem 'capistrano-rails', group: :development 32 33group :development, :test do 34 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 35 gem 'byebug', platform: :mri 36end 37 38group :development do 39 # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 40 gem 'web-console' 41 gem 'listen', '~> 3.0.5' 42 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 43 gem 'spring' 44 gem 'spring-watcher-listen', '~> 2.0.0' 45end 46 47# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 48gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 49
このエラーがどういう意味ですか?
このエラーはどう解決すればいいですか?
(Cloud9を使って開発しています。)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。