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

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

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

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

Ruby on Rails

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

Q&A

解決済

1回答

761閲覧

Gem追加 → bundle update → rails sを実行するとエラーが発生

goffee555

総合スコア6

RubyGems

RubyGemsはRubyによるプログラミングのためのパッケージマネジメントツールです。ユーザはこれを使用することで、Rubyライブラリのダウンロードやアップデートや、依存関係の自動解決が可能になります。

Ruby on Rails

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

0グッド

0クリップ

投稿2020/05/31 11:12

編集2020/06/01 11:49

前提・実現したいこと

この度、初めて質問させていただきます。
至らない点が多々あると思いますが、どうぞ宜しくお願いします。

□経緯

新たにRailsアプリケーションを作成するためにファイルを作成。

terminal

1rails _5.2.1_ new bestcamp -d mysql

GemfileにGemを追加、bundle updateを実行。

Gemfile

1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.5.1' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 5.2.1' 8# Use mysql as the database for Active Record 9gem 'mysql2', '>= 0.4.4', '< 0.6.0' 10# Use Puma as the app server 11gem 'puma', '~> 3.11' 12# Use SCSS for stylesheets 13gem 'sass-rails', '~> 5.0' 14# Use Uglifier as compressor for JavaScript assets 15gem 'uglifier', '>= 1.3.0' 16# See https://github.com/rails/execjs#readme for more supported runtimes 17# gem 'mini_racer', platforms: :ruby 18 19# Use CoffeeScript for .coffee assets and views 20gem 'coffee-rails', '~> 4.2' 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', '~> 4.0' 27# Use ActiveModel has_secure_password 28# gem 'bcrypt', '~> 3.1.7' 29 30# Use ActiveStorage variant 31# gem 'mini_magick', '~> 4.8' 32 33# Use Capistrano for deployment 34# gem 'capistrano-rails', group: :development 35 36# Reduces boot times through caching; required in config/boot.rb 37gem 'bootsnap', '>= 1.1.0', require: false 38 39group :development, :test do 40 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 41 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 42end 43 44group :development do 45 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 46 gem 'web-console', '>= 3.3.0' 47 gem 'listen', '>= 3.0.5', '< 3.2' 48 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 49 gem 'spring' 50 gem 'spring-watcher-listen', '~> 2.0.0' 51end 52 53group :test do 54 # Adds support for Capybara system testing and selenium driver 55 gem 'capybara', '>= 2.15' 56 gem 'selenium-webdriver' 57 # Easy installation and use of chromedriver to run system tests with Chrome 58 gem 'chromedriver-helper' 59end 60 61# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 62gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 63#以下、追加 64gem 'pry-rails' 65gem 'devise' 66gem 'therubyracer' 67gem 'twitter-bootstrap-rails' 68gem 'bootstrap-material-design', '0.1.4' 69gem 'jquery-rails' 70gem "font-awesome-rails" 71gem 'mini_magick' 72gem 'kaminari' 73gem 'redcarpet' 74gem 'coderay'

その後、rails sでサーバーを起動させると以下のエラーが発生。

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

terminal

1ec2-user:~/environment/bestcamp (master) $ rails s 2Traceback (most recent call last): 3 76: from bin/rails:3:in `<main>' 4 75: from bin/rails:3:in `load' 5 74: from /home/ec2-user/environment/bestcamp/bin/spring:15:in `<top (required)>' 6 73: from /home/ec2-user/environment/bestcamp/bin/spring:15:in `require' 7 72: from /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' 8 //中略// 9 3: from /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 10 2: from /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register' 11 1: from /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 12/home/ec2-user/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': cannot load such file -- coderay (LoadError)

試したこと

  • リストGemfileのgem ‘tzinfo-data’からplatformsオプションを削除し、bundle updateを実行。

  • リストGemfileからgem ‘tzinfo-data’の行を消去し、bundle updateを実行。

  • リストGemfile.lockのファイルを削除してからもう一度bundle install。

  • 手を加えていない状態のGemfileでrails sを実行すると問題なし。

情報が不足していた場合、そのご指示と、解決の手法をご教授願います。

よろしくお願いいたします。

###追記
coderayのファイルが見つからないためエラーがでたと推測し、下記実行

terminal

1ec2-user:~/environment/bestcamp (master) $ gem list coderay 2 3*** LOCAL GEMS *** 4 5coderay (default: 1.1.3, 1.1.2) 6ec2-user:~/environment/bestcamp (master) $ sudo gem list coderay 7 8*** LOCAL GEMS *** 9 10

Gemfile.lookが変だと感じたので追記します。

Gemfilelool

1GEM 2 remote: https://rubygems.org/ 3 specs: 4 actioncable (5.2.4.3) 5 actionpack (= 5.2.4.3) 6 nio4r (~> 2.0) 7 websocket-driver (>= 0.6.1) 8 actionmailer (5.2.4.3) 9 actionpack (= 5.2.4.3) 10 actionview (= 5.2.4.3) 11 activejob (= 5.2.4.3) 12 mail (~> 2.5, >= 2.5.4) 13 rails-dom-testing (~> 2.0) 14 actionpack (5.2.4.3) 15 actionview (= 5.2.4.3) 16 activesupport (= 5.2.4.3) 17 rack (~> 2.0, >= 2.0.8) 18 rack-test (>= 0.6.3) 19 rails-dom-testing (~> 2.0) 20 rails-html-sanitizer (~> 1.0, >= 1.0.2) 21 actionview (5.2.4.3) 22 activesupport (= 5.2.4.3) 23 builder (~> 3.1) 24 erubi (~> 1.4) 25 rails-dom-testing (~> 2.0) 26 rails-html-sanitizer (~> 1.0, >= 1.0.3) 27 activejob (5.2.4.3) 28 activesupport (= 5.2.4.3) 29 globalid (>= 0.3.6) 30 activemodel (5.2.4.3) 31 activesupport (= 5.2.4.3) 32 activerecord (5.2.4.3) 33 activemodel (= 5.2.4.3) 34 activesupport (= 5.2.4.3) 35 arel (>= 9.0) 36 activestorage (5.2.4.3) 37 actionpack (= 5.2.4.3) 38 activerecord (= 5.2.4.3) 39 marcel (~> 0.3.1) 40 activesupport (5.2.4.3) 41 concurrent-ruby (~> 1.0, >= 1.0.2) 42 i18n (>= 0.7, < 2) 43 minitest (~> 5.1) 44 tzinfo (~> 1.1) 45 addressable (2.7.0) 46 public_suffix (>= 2.0.2, < 5.0) 47 archive-zip (0.12.0) 48 io-like (~> 0.3.0) 49 arel (9.0.0) 50 autoprefixer-rails (9.7.6) 51 execjs 52 bcrypt (3.1.13) 53 bindex (0.8.1) 54 bootsnap (1.4.6) 55 msgpack (~> 1.0) 56 bootstrap-material-design (0.1.4) 57 bootstrap-sass (~> 3.0) 58 bootstrap-sass (3.4.1) 59 autoprefixer-rails (>= 5.2.1) 60 sassc (>= 2.0.0) 61 builder (3.2.4) 62 byebug (11.1.3) 63 capybara (3.32.2) 64 addressable 65 mini_mime (>= 0.1.3) 66 nokogiri (~> 1.8) 67 rack (>= 1.6.0) 68 rack-test (>= 0.6.3) 69 regexp_parser (~> 1.5) 70 xpath (~> 3.2) 71 childprocess (3.0.0) 72 chromedriver-helper (2.1.1) 73 archive-zip (~> 0.10) 74 nokogiri (~> 1.8) 75 coderay (1.1.3) 76 coffee-rails (4.2.2) 77 coffee-script (>= 2.2.0) 78 railties (>= 4.0.0) 79 coffee-script (2.4.1) 80 coffee-script-source 81 execjs 82 coffee-script-source (1.12.2) 83 commonjs (0.2.7) 84 concurrent-ruby (1.1.6) 85 crass (1.0.6) 86 devise (4.7.1) 87 bcrypt (~> 3.0) 88 orm_adapter (~> 0.1) 89 railties (>= 4.1.0) 90 responders 91 warden (~> 1.2.3) 92 erubi (1.9.0) 93 execjs (2.7.0) 94 ffi (1.13.0) 95 font-awesome-rails (4.7.0.5) 96 railties (>= 3.2, < 6.1) 97 globalid (0.4.2) 98 activesupport (>= 4.2.0) 99 i18n (1.8.2) 100 concurrent-ruby (~> 1.0) 101 io-like (0.3.1) 102 jbuilder (2.10.0) 103 activesupport (>= 5.0.0) 104 jquery-rails (4.4.0) 105 rails-dom-testing (>= 1, < 3) 106 railties (>= 4.2.0) 107 thor (>= 0.14, < 2.0) 108 kaminari (1.2.1) 109 activesupport (>= 4.1.0) 110 kaminari-actionview (= 1.2.1) 111 kaminari-activerecord (= 1.2.1) 112 kaminari-core (= 1.2.1) 113 kaminari-actionview (1.2.1) 114 actionview 115 kaminari-core (= 1.2.1) 116 kaminari-activerecord (1.2.1) 117 activerecord 118 kaminari-core (= 1.2.1) 119 kaminari-core (1.2.1) 120 less (2.6.0) 121 commonjs (~> 0.2.7) 122 less-rails (2.8.0) 123 actionpack (>= 4.0) 124 less (~> 2.6.0) 125 sprockets (> 2, < 4) 126 tilt 127 libv8 (3.16.14.19) 128 listen (3.1.5) 129 rb-fsevent (~> 0.9, >= 0.9.4) 130 rb-inotify (~> 0.9, >= 0.9.7) 131 ruby_dep (~> 1.2) 132 loofah (2.5.0) 133 crass (~> 1.0.2) 134 nokogiri (>= 1.5.9) 135 136 //文字制限のため一部省略// 137 138 139 140 execjs (>= 0.3.0, < 3) 141 warden (1.2.8) 142 rack (>= 2.0.6) 143 web-console (3.7.0) 144 actionview (>= 5.0) 145 activemodel (>= 5.0) 146 bindex (>= 0.4.0) 147 railties (>= 5.0) 148 websocket-driver (0.7.2) 149 websocket-extensions (>= 0.1.0) 150 websocket-extensions (0.1.4) 151 xpath (3.2.0) 152 nokogiri (~> 1.8) 153 154PLATFORMS 155 ruby 156 157DEPENDENCIES 158 bootsnap (>= 1.1.0) 159 bootstrap-material-design (= 0.1.4) 160 byebug 161 capybara (>= 2.15) 162 chromedriver-helper 163 coderay 164 coffee-rails (~> 4.2) 165 devise 166 font-awesome-rails 167 jbuilder (~> 2.5) 168 jquery-rails 169 kaminari 170 listen (>= 3.0.5, < 3.2) 171 mini_magick 172 mysql2 (>= 0.4.4, < 0.6.0) 173 pry-rails 174 puma (~> 3.11) 175 rails (~> 5.2.1) 176 redcarpet 177 sass-rails (~> 5.0) 178 selenium-webdriver 179 spring 180 spring-watcher-listen (~> 2.0.0) 181 therubyracer 182 turbolinks (~> 5) 183 twitter-bootstrap-rails 184 tzinfo-data 185 uglifier (>= 1.3.0) 186 web-console (>= 3.3.0) 187 188RUBY VERSION 189 ruby 2.5.1p57 190 191BUNDLED WITH 192 2.1.4 193

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

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

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

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

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

unoSSkR

2020/06/02 11:45

Im afraid you should decide whether you use rvm or not.
guest

回答1

0

ベストアンサー

新たにRailsアプリケーションを作成するためにファイルを作成。

どんなファイルを作ったのか?

GemfileにGemを追加、

どんなGemを追加したのか?

bundle updateを実行。その後、rails sでサーバーを起動

rails newを実行していない。

結論:情報不足で何の回答もできませんし、当然railsサーバは動きません。

投稿2020/05/31 12:05

technocore

総合スコア7225

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

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

goffee555

2020/05/31 13:10

technocoreさん、回答頂きありがとうございます。 補足を追加しましたが、まだ情報が不足していた場合、ご指摘願います。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問