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

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

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

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

Ruby on Rails

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

Q&A

1回答

876閲覧

Your Ruby version is 2.6.3, but your Gemfile specified 2.6.2 バージョンを合わせたい

nisetogashi

総合スコア6

Ruby

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

Ruby on Rails

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

0グッド

0クリップ

投稿2023/04/14 12:45

実現したいこと>

bundle install を行なった際にエラーが起きずにいきたい

前提

ruby on rails でアプリケーションのデプロイ作業を行なっています。

bundle installコマンド時にエラーが発生してしまいデバックに難航しています。バージョンの古い教材で行なっていたためアップデートなどを行いましたが、解決の糸口が見つかりません。似たようなエラーがないが検索を行い試しましたがうまく行かず、原因が分かりません。なんとか解決したいです。

Gemfile

1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.6.2' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 5.2.7' 8# Use sqlite3 as the database for Active Record 9gem 'sqlite3' 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 62#gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] #コメントアウト 63gem 'devise' 64gem "simple_calendar", "~> 2.0" 65gem 'bootstrap', '~> 4.5' 66gem 'jquery-rails' 67gem 'psych', '~> 3.1' #追記 68 69gem 'dotenv-rails' 70group :production do 71 gem 'mysql2' 72end

gemfile.look

1GEM 2 remote: https://rubygems.org/ 3 specs: 4 actioncable (5.2.7) 5 actionpack (= 5.2.7) 6 nio4r (~> 2.0) 7 websocket-driver (>= 0.6.1) 8 actionmailer (5.2.7) 9 actionpack (= 5.2.7) 10 actionview (= 5.2.7) 11 activejob (= 5.2.7) 12 mail (~> 2.5, >= 2.5.4) 13 rails-dom-testing (~> 2.0) 14 actionpack (5.2.7) 15 actionview (= 5.2.7) 16 activesupport (= 5.2.7) 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.7) 22 activesupport (= 5.2.7) 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.7) 28 activesupport (= 5.2.7) 29 globalid (>= 0.3.6) 30 activemodel (5.2.7) 31 activesupport (= 5.2.7) 32 activerecord (5.2.7) 33 activemodel (= 5.2.7) 34 activesupport (= 5.2.7) 35 arel (>= 9.0) 36 activestorage (5.2.7) 37 actionpack (= 5.2.7) 38 activerecord (= 5.2.7) 39 marcel (~> 1.0.0) 40 activesupport (5.2.7) 41 concurrent-ruby (~> 1.0, >= 1.0.2) 42 i18n (>= 0.7, < 2) 43 minitest (~> 5.1) 44 tzinfo (~> 1.1) 45 addressable (2.8.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 (10.4.7.0) 51 execjs (~> 2) 52 bcrypt (3.1.17) 53 bindex (0.8.1) 54 bootsnap (1.11.1) 55 msgpack (~> 1.2) 56 bootstrap (4.6.1) 57 autoprefixer-rails (>= 9.1.0) 58 popper_js (>= 1.14.3, < 2) 59 sassc-rails (>= 2.0.0) 60 builder (3.2.4) 61 byebug (11.1.3) 62 capybara (3.36.0) 63 addressable 64 matrix 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, < 3.0) 70 xpath (~> 3.2) 71 childprocess (4.1.0) 72 chromedriver-helper (2.1.1) 73 archive-zip (~> 0.10) 74 nokogiri (~> 1.8) 75 coffee-rails (4.2.2) 76 coffee-script (>= 2.2.0) 77 railties (>= 4.0.0) 78 coffee-script (2.4.1) 79 coffee-script-source 80 execjs 81 coffee-script-source (1.12.2) 82 concurrent-ruby (1.1.10) 83 crass (1.0.6) 84 devise (4.8.1) 85 bcrypt (~> 3.0) 86 orm_adapter (~> 0.1) 87 railties (>= 4.1.0) 88 responders 89 warden (~> 1.2.3) 90 dotenv (2.7.6) 91 dotenv-rails (2.7.6) 92 dotenv (= 2.7.6) 93 railties (>= 3.2) 94 erubi (1.10.0) 95 execjs (2.8.1) 96 ffi (1.15.5) 97 globalid (1.0.0) 98 activesupport (>= 5.0) 99 i18n (1.10.0) 100 concurrent-ruby (~> 1.0) 101 io-like (0.3.1) 102 jbuilder (2.11.5) 103 actionview (>= 5.0.0) 104 activesupport (>= 5.0.0) 105 jquery-rails (4.4.0) 106 rails-dom-testing (>= 1, < 3) 107 railties (>= 4.2.0) 108 thor (>= 0.14, < 2.0) 109 listen (3.1.5) 110 rb-fsevent (~> 0.9, >= 0.9.4) 111 rb-inotify (~> 0.9, >= 0.9.7) 112 ruby_dep (~> 1.2) 113 loofah (2.15.0) 114 crass (~> 1.0.2) 115 nokogiri (>= 1.5.9) 116 mail (2.7.1) 117 mini_mime (>= 0.1.1) 118 marcel (1.0.2) 119 matrix (0.4.2) 120 method_source (1.0.0) 121 mini_mime (1.1.2) 122 mini_portile2 (2.8.0) 123 minitest (5.15.0) 124 msgpack (1.4.5) 125 mysql2 (0.5.5) 126 nio4r (2.5.8) 127 nokogiri (1.13.3) 128 mini_portile2 (~> 2.8.0) 129 racc (~> 1.4) 130 orm_adapter (0.5.0) 131 popper_js (1.16.0) 132 psych (3.3.4) 133 public_suffix (4.0.6) 134 puma (3.12.6) 135 racc (1.6.0) 136 rack (2.2.3) 137 rack-test (1.1.0) 138 rack (>= 1.0, < 3) 139 rails (5.2.7) 140 actioncable (= 5.2.7) 141 actionmailer (= 5.2.7) 142 actionpack (= 5.2.7) 143 actionview (= 5.2.7) 144 activejob (= 5.2.7) 145 activemodel (= 5.2.7) 146 activerecord (= 5.2.7) 147 activestorage (= 5.2.7) 148 activesupport (= 5.2.7) 149 bundler (>= 1.3.0) 150 railties (= 5.2.7) 151 sprockets-rails (>= 2.0.0) 152 rails-dom-testing (2.0.3) 153 activesupport (>= 4.2.0) 154 nokogiri (>= 1.6) 155 rails-html-sanitizer (1.4.2) 156 loofah (~> 2.3) 157 railties (5.2.7) 158 actionpack (= 5.2.7) 159 activesupport (= 5.2.7) 160 method_source 161 rake (>= 0.8.7) 162 thor (>= 0.19.0, < 2.0) 163 rake (13.0.6) 164 rb-fsevent (0.11.1) 165 rb-inotify (0.10.1) 166 ffi (~> 1.0) 167 regexp_parser (2.2.1) 168 responders (3.0.1) 169 actionpack (>= 5.0) 170 railties (>= 5.0) 171 rexml (3.2.5) 172 ruby_dep (1.5.0) 173 rubyzip (2.3.2) 174 sass (3.7.4) 175 sass-listen (~> 4.0.0) 176 sass-listen (4.0.0) 177 rb-fsevent (~> 0.9, >= 0.9.4) 178 rb-inotify (~> 0.9, >= 0.9.7) 179 sass-rails (5.1.0) 180 railties (>= 5.2.0) 181 sass (~> 3.1) 182 sprockets (>= 2.8, < 4.0) 183 sprockets-rails (>= 2.0, < 4.0) 184 tilt (>= 1.1, < 3) 185 sassc (2.4.0) 186 ffi (~> 1.9) 187 sassc-rails (2.1.2) 188 railties (>= 4.0.0) 189 sassc (>= 2.0) 190 sprockets (> 3.0) 191 sprockets-rails 192 tilt 193 selenium-webdriver (4.1.0) 194 childprocess (>= 0.5, < 5.0) 195 rexml (~> 3.2, >= 3.2.5) 196 rubyzip (>= 1.2.2) 197 simple_calendar (2.4.3) 198 rails (>= 3.0) 199 spring (2.1.1) 200 spring-watcher-listen (2.0.1) 201 listen (>= 2.7, < 4.0) 202 spring (>= 1.2, < 3.0) 203 sprockets (3.7.2) 204 concurrent-ruby (~> 1.0) 205 rack (> 1, < 3) 206 sprockets-rails (3.4.2) 207 actionpack (>= 5.2) 208 activesupport (>= 5.2) 209 sprockets (>= 3.0.0) 210 sqlite3 (1.4.2) 211 thor (1.2.1) 212 thread_safe (0.3.6) 213 tilt (2.0.10) 214 turbolinks (5.2.1) 215 turbolinks-source (~> 5.2) 216 turbolinks-source (5.2.0) 217 tzinfo (1.2.9) 218 thread_safe (~> 0.1) 219 uglifier (4.2.0) 220 execjs (>= 0.3.0, < 3) 221 warden (1.2.9) 222 rack (>= 2.0.9) 223 web-console (3.7.0) 224 actionview (>= 5.0) 225 activemodel (>= 5.0) 226 bindex (>= 0.4.0) 227 railties (>= 5.0) 228 websocket-driver (0.7.5) 229 websocket-extensions (>= 0.1.0) 230 websocket-extensions (0.1.5) 231 xpath (3.2.0) 232 nokogiri (~> 1.8) 233 234PLATFORMS 235 ruby 236 237DEPENDENCIES 238 bootsnap (>= 1.1.0) 239 bootstrap (~> 4.5) 240 byebug 241 capybara (>= 2.15) 242 chromedriver-helper 243 coffee-rails (~> 4.2) 244 devise 245 dotenv-rails 246 jbuilder (~> 2.5) 247 jquery-rails 248 listen (>= 3.0.5, < 3.2) 249 mysql2 250 psych (~> 3.1) 251 puma (~> 3.11) 252 rails (~> 5.2.7) 253 sass-rails (~> 5.0) 254 selenium-webdriver 255 simple_calendar (~> 2.0) 256 spring 257 spring-watcher-listen (~> 2.0.0) 258 sqlite3 259 turbolinks (~> 5) 260 uglifier (>= 1.3.0) 261 web-console (>= 3.3.0) 262 263RUBY VERSION 264 ruby 2.6.3p62 265 266BUNDLED WITH 267 2.4.12 268

試したこと

まず初めに
https://qiita.com/ryu1sazae/items/ee308dd1c11faf6f3eb0
記事を参考にしましたが、
brew install rbenv ruby-buildコマンドで
bash: brew: command not found エラーで弾かれます。

続いて、bundleのバージョンをアップデートするために
bash: brew: command not found で検索をかけましたがいい記事が見つかりませんでした。

その他
・EC2上のRubyとbundleが古かったためアップデートを行いましたがエラー解決には至りませんでした。
・Cloud9のrubyとgemfile.lookのバージョンに差異が合ったため同じバージョンに変更しました。

補足情報(FW/ツールのバージョンなど)

< EC2 本番環境>
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
Rails 5.2.7
Bundler version 1.17.3

<Cloud9 開発環境>
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
Rails 6.1.4
Bundler version 2.2.3
※ 以下コマンドを行いましたが、バージョンを変更できませんでした。
$gem uninstall bunder -v 2.2.3
$gem install bundler -v 1.17.3
$bundle -v

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

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

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

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

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

guest

回答1

0

Gemfileの2.6.2という部分を、2.6.3にしてbundle installするといいと思います

Gemfile

1ruby '2.6.3'

投稿2023/04/14 13:07

hatsu

総合スコア1809

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

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

nisetogashi

2023/04/14 13:23

ありがとうございます。無事解決しました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問