AWS Cloud9上で rails serverが立ち上がらない。
- 評価
- クリップ 0
- VIEW 1,229
前提・実現したいこと
AWS Cloud9を使用した際、rails serverを行っても、サーバーが立ち上がらない。
発生している問題・エラーメッセージ
ec2-user:~/environment/tweet_app $ rails server
=> Booting Puma
=> Rails 5.0.7.2 application starting in development on http://localhost:8080
=> Run rails server -h
for more startup options
Puma starting in single mode...
- Version 3.12.1 (ruby 2.6.3-p62), codename: Llamas in Pajamas
- Min threads: 5, max threads: 5
- Environment: development
- Listening on tcp://localhost:8080
Use Ctrl-C to stop
Started GET "/" for 182.167.32.231 at 2019-05-19 02:43:52 +0000
Cannot render console from 182.167.32.231! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
Gem::LoadError (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).):
activerecord (5.0.7.2) lib/active_record/connection_adapters/connection_specification.rb:176:in rescue in spec'
activerecord (5.0.7.2) lib/active_record/connection_adapters/connection_specification.rb:173:in
spec'
activerecord (5.0.7.2) lib/active_record/connection_handling.rb:53:in establish_connection'
activerecord (5.0.7.2) lib/active_record/railtie.rb:125:in
block (2 levels) in <class:Railtie>'
activesupport (5.0.7.2) lib/active_support/lazy_load_hooks.rb:69:in instance_eval'
activesupport (5.0.7.2) lib/active_support/lazy_load_hooks.rb:69:in
block in execute_hook'
activesupport (5.0.7.2) lib/active_support/lazy_load_hooks.rb:60:in with_execution_control'
activesupport (5.0.7.2) lib/active_support/lazy_load_hooks.rb:65:in
execute_hook'
activesupport (5.0.7.2) lib/active_support/lazy_load_hooks.rb:50:in block in run_load_hooks'
activesupport (5.0.7.2) lib/active_support/lazy_load_hooks.rb:49:in
each'
activesupport (5.0.7.2) lib/active_support/lazy_load_hooks.rb:49:in run_load_hooks'
activerecord (5.0.7.2) lib/active_record/base.rb:324:in
<module:ActiveRecord>'
activerecord (5.0.7.2) lib/active_record/base.rb:24:in <top (required)>'
activesupport (5.0.7.2) lib/active_support/dependencies.rb:293:in
require'
activesupport (5.0.7.2) lib/active_support/dependencies.rb:293:in block in require'
activesupport (5.0.7.2) lib/active_support/dependencies.rb:259:in
load_dependency'
activesupport (5.0.7.2) lib/active_support/dependencies.rb:293:in require'
activerecord (5.0.7.2) lib/active_record/migration.rb:559:in
connection'
activerecord (5.0.7.2) lib/active_record/migration.rb:546:in call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/callbacks.rb:38:in
block in call'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:97:in __run_callbacks__'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:750:in
_run_call_callbacks'
activesupport (5.0.7.2) lib/active_support/callbacks.rb:90:in run_callbacks'
actionpack (5.0.7.2) lib/action_dispatch/middleware/callbacks.rb:36:in
call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/remote_ip.rb:79:in
call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/debug_exceptions.rb:49:in call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in
call_app'
web-console (3.7.0) lib/web_console/middleware.rb:22:in block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in
catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/show_exceptions.rb:31:in
call'
railties (5.0.7.2) lib/rails/rack/logger.rb:36:in call_app'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in
block in call'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in block in tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:26:in
tagged'
activesupport (5.0.7.2) lib/active_support/tagged_logging.rb:69:in tagged'
railties (5.0.7.2) lib/rails/rack/logger.rb:24:in
call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/request_id.rb:24:in
call'
rack (2.0.7) lib/rack/method_override.rb:22:in call'
rack (2.0.7) lib/rack/runtime.rb:22:in
call'
activesupport (5.0.7.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/executor.rb:12:in
call'
actionpack (5.0.7.2) lib/action_dispatch/middleware/static.rb:136:in call'
rack (2.0.7) lib/rack/sendfile.rb:111:in
call'
railties (5.0.7.2) lib/rails/engine.rb:522:in call'
puma (3.12.1) lib/puma/configuration.rb:227:in
call'
puma (3.12.1) lib/puma/server.rb:660:in handle_request'
puma (3.12.1) lib/puma/server.rb:474:in
process_client'
puma (3.12.1) lib/puma/server.rb:334:in block in run'
puma (3.12.1) lib/puma/thread_pool.rb:135:in
block in spawn_thread'
Rendering /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout
Rendering /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
Rendered /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (1.7ms)
Rendering /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
Rendered /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.0ms)
Rendering /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
Rendered /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.6ms)
Rendered /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (15.6ms)
該当のソースコード
rails
試したこと
$ rails new tweet_app
$ cd tweet_app
$ rails server
補足情報(FW/ツールのバージョンなど)
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
checkベストアンサー
0
このあたりの情報が参考になるかもしれません。sqlite3のバージョンを指定しています。
https://teratail.com/questions/175251
https://qiita.com/oke-py/items/81f5db332131e5d88cf4
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.13%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
質問への追記・修正、ベストアンサー選択の依頼
psuke
2019/05/20 21:50
Add gem 'sqlite3' to your Gemfileと表示されています。tweet_appディレクトリにあるGemfileの中身を記載していただけますでしょうか。
Aokichingo
2019/05/21 16:25
こちらです。何卒よろしくお願いします。
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]