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

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

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

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

Ruby on Rails 5

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

Ruby

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

Q&A

解決済

1回答

1128閲覧

rails g model User name:string phone:stringでエラーが発生することについて

hazu

総合スコア33

Cloud9

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

Ruby on Rails 5

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

Ruby

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

0グッド

1クリップ

投稿2019/02/25 14:33

編集2019/02/25 14:36

手順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を使って開発しています。)

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

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

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

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

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

guest

回答1

0

ベストアンサー

bundle installをしてないだけじゃないですかね?

投稿2019/02/26 23:41

Kta-M

総合スコア456

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問