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

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

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

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

Ruby on Rails

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

Q&A

解決済

1回答

1873閲覧

renderへのデプロイに失敗して困っています。

K-Yama

総合スコア1

Ruby

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

Ruby on Rails

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

0グッド

0クリップ

投稿2023/12/16 07:11

編集2023/12/16 07:18

実現したいこと

renderへのデプロイを成功させたいです。

前提

ruby on rails でアプリを作成するためrenderへのデプロイを行ったところエラーが出てデプロイができない状態です。
まだ機能の実装は行なっておりません。
以下のエラーメッセージが発生しました。

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

renderのログに表示されているエラー文です。

Fix installation error of same version of default gems with local

該当のソースコード

ruby

render

1#!/usr/bin/env bash 2# exit on error 3set -o errexit 4 5bundle install 6bundle exec rake assets:precompile 7bundle exec rake assets:clean 8bundle exec rake db:migrate

config/database.yml

1default: &default 2 encoding: utf8 3 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 4 5development: 6 <<: *default 7 adapter: mysql2 8 username: root 9 password: 10 host: localhost 11 database: task_memo_development 12 13test: 14 <<: *default 15 adapter: mysql2 16 username: root 17 password: 18 host: localhost 19 database: task_memo_test 20 21production: 22 <<: *default 23 adapter: postgresql 24 url: <%= ENV['DATABASE_URL'] %>

Gemfile

1(省略) 2group :production do 3 gem 'pg' 4end 5(省略)

Gemfile.lock

1GEM 2 remote: https://rubygems.org/ 3 specs: 4 actioncable (7.0.8) 5 actionpack (= 7.0.8) 6 activesupport (= 7.0.8) 7 nio4r (~> 2.0) 8 websocket-driver (>= 0.6.1) 9 actionmailbox (7.0.8) 10 actionpack (= 7.0.8) 11 activejob (= 7.0.8) 12 activerecord (= 7.0.8) 13 activestorage (= 7.0.8) 14 activesupport (= 7.0.8) 15 mail (>= 2.7.1) 16 net-imap 17 net-pop 18 net-smtp 19 actionmailer (7.0.8) 20 actionpack (= 7.0.8) 21 actionview (= 7.0.8) 22 activejob (= 7.0.8) 23 activesupport (= 7.0.8) 24 mail (~> 2.5, >= 2.5.4) 25 net-imap 26 net-pop 27 net-smtp 28 rails-dom-testing (~> 2.0) 29 actionpack (7.0.8) 30 actionview (= 7.0.8) 31 activesupport (= 7.0.8) 32 rack (~> 2.0, >= 2.2.4) 33 rack-test (>= 0.6.3) 34 rails-dom-testing (~> 2.0) 35 rails-html-sanitizer (~> 1.0, >= 1.2.0) 36 actiontext (7.0.8) 37 actionpack (= 7.0.8) 38 activerecord (= 7.0.8) 39 activestorage (= 7.0.8) 40 activesupport (= 7.0.8) 41 globalid (>= 0.6.0) 42 nokogiri (>= 1.8.5) 43 actionview (7.0.8) 44 activesupport (= 7.0.8) 45 builder (~> 3.1) 46 erubi (~> 1.4) 47 rails-dom-testing (~> 2.0) 48 rails-html-sanitizer (~> 1.1, >= 1.2.0) 49 activejob (7.0.8) 50 activesupport (= 7.0.8) 51 globalid (>= 0.3.6) 52 activemodel (7.0.8) 53 activesupport (= 7.0.8) 54 activerecord (7.0.8) 55 activemodel (= 7.0.8) 56 activesupport (= 7.0.8) 57 activestorage (7.0.8) 58 actionpack (= 7.0.8) 59 activejob (= 7.0.8) 60 activerecord (= 7.0.8) 61 activesupport (= 7.0.8) 62 marcel (~> 1.0) 63 mini_mime (>= 1.1.0) 64 activesupport (7.0.8) 65 concurrent-ruby (~> 1.0, >= 1.0.2) 66 i18n (>= 1.6, < 2) 67 minitest (>= 5.1) 68 tzinfo (~> 2.0) 69 addressable (2.8.6) 70 public_suffix (>= 2.0.2, < 6.0) 71 bindex (0.8.1) 72 bootsnap (1.17.0) 73 msgpack (~> 1.2) 74 builder (3.2.4) 75 capybara (3.39.2) 76 addressable 77 matrix 78 mini_mime (>= 0.1.3) 79 nokogiri (~> 1.8) 80 rack (>= 1.6.0) 81 rack-test (>= 0.6.3) 82 regexp_parser (>= 1.5, < 3.0) 83 xpath (~> 3.2) 84 concurrent-ruby (1.2.2) 85 crass (1.0.6) 86 date (3.3.4) 87 debug (1.9.0) 88 irb (~> 1.10) 89 reline (>= 0.3.8) 90 erubi (1.12.0) 91 globalid (1.2.1) 92 activesupport (>= 6.1) 93 i18n (1.14.1) 94 concurrent-ruby (~> 1.0) 95 importmap-rails (1.2.3) 96 actionpack (>= 6.0.0) 97 activesupport (>= 6.0.0) 98 railties (>= 6.0.0) 99 io-console (0.7.1) 100 irb (1.10.1) 101 rdoc 102 reline (>= 0.3.8) 103 jbuilder (2.11.5) 104 actionview (>= 5.0.0) 105 activesupport (>= 5.0.0) 106 loofah (2.22.0) 107 crass (~> 1.0.2) 108 nokogiri (>= 1.12.0) 109 mail (2.8.1) 110 mini_mime (>= 0.1.1) 111 net-imap 112 net-pop 113 net-smtp 114 marcel (1.0.2) 115 matrix (0.4.2) 116 method_source (1.0.0) 117 mini_mime (1.1.5) 118 minitest (5.20.0) 119 msgpack (1.7.2) 120 mysql2 (0.5.5) 121 net-imap (0.4.8) 122 date 123 net-protocol 124 net-pop (0.1.2) 125 net-protocol 126 net-protocol (0.2.2) 127 timeout 128 net-smtp (0.4.0) 129 net-protocol 130 nio4r (2.7.0) 131 nokogiri (1.15.5-x86_64-darwin) 132 racc (~> 1.4) 133 nokogiri (1.15.5-x86_64-linux) 134 racc (~> 1.4) 135 pg (1.5.4) 136 psych (5.1.1.1) 137 stringio 138 public_suffix (5.0.4) 139 puma (5.6.7) 140 nio4r (~> 2.0) 141 racc (1.7.3) 142 rack (2.2.8) 143 rack-test (2.1.0) 144 rack (>= 1.3) 145 rails (7.0.8) 146 actioncable (= 7.0.8) 147 actionmailbox (= 7.0.8) 148 actionmailer (= 7.0.8) 149 actionpack (= 7.0.8) 150 actiontext (= 7.0.8) 151 actionview (= 7.0.8) 152 activejob (= 7.0.8) 153 activemodel (= 7.0.8) 154 activerecord (= 7.0.8) 155 activestorage (= 7.0.8) 156 activesupport (= 7.0.8) 157 bundler (>= 1.15.0) 158 railties (= 7.0.8) 159 rails-dom-testing (2.2.0) 160 activesupport (>= 5.0.0) 161 minitest 162 nokogiri (>= 1.6) 163 rails-html-sanitizer (1.6.0) 164 loofah (~> 2.21) 165 nokogiri (~> 1.14) 166 railties (7.0.8) 167 actionpack (= 7.0.8) 168 activesupport (= 7.0.8) 169 method_source 170 rake (>= 12.2) 171 thor (~> 1.0) 172 zeitwerk (~> 2.5) 173 rake (13.1.0) 174 rdoc (6.6.2) 175 psych (>= 4.0.0) 176 regexp_parser (2.8.3) 177 reline (0.4.1) 178 io-console (~> 0.5) 179 rexml (3.2.6) 180 rubyzip (2.3.2) 181 selenium-webdriver (4.10.0) 182 rexml (~> 3.2, >= 3.2.5) 183 rubyzip (>= 1.2.2, < 3.0) 184 websocket (~> 1.0) 185 sprockets (4.2.1) 186 concurrent-ruby (~> 1.0) 187 rack (>= 2.2.4, < 4) 188 sprockets-rails (3.4.2) 189 actionpack (>= 5.2) 190 activesupport (>= 5.2) 191 sprockets (>= 3.0.0) 192 stimulus-rails (1.3.0) 193 railties (>= 6.0.0) 194 stringio (3.1.0) 195 thor (1.3.0) 196 timeout (0.4.1) 197 turbo-rails (1.5.0) 198 actionpack (>= 6.0.0) 199 activejob (>= 6.0.0) 200 railties (>= 6.0.0) 201 tzinfo (2.0.6) 202 concurrent-ruby (~> 1.0) 203 web-console (4.2.1) 204 actionview (>= 6.0.0) 205 activemodel (>= 6.0.0) 206 bindex (>= 0.4.0) 207 railties (>= 6.0.0) 208 webdrivers (5.3.1) 209 nokogiri (~> 1.6) 210 rubyzip (>= 1.3.0) 211 selenium-webdriver (~> 4.0, < 4.11) 212 websocket (1.2.10) 213 websocket-driver (0.7.6) 214 websocket-extensions (>= 0.1.0) 215 websocket-extensions (0.1.5) 216 xpath (3.2.0) 217 nokogiri (~> 1.8) 218 zeitwerk (2.6.12) 219 220PLATFORMS 221 x86_64-darwin-22 222 x86_64-linux 223 224DEPENDENCIES 225 bootsnap 226 capybara 227 debug 228 importmap-rails 229 jbuilder 230 mysql2 (~> 0.5) 231 pg 232 puma (~> 5.0) 233 rails (~> 7.0.0) 234 selenium-webdriver 235 sprockets-rails 236 stimulus-rails 237 turbo-rails 238 tzinfo-data 239 web-console 240 webdrivers 241 242RUBY VERSION 243 ruby 3.2.0p0 244 245BUNDLED WITH 246 2.4.1

試したこと

デフォルトのジェムとローカルで同じバージョンのジェムがインストールされている場合に発生する可能性があるとのことでした。
原因が本当にバージョンの違いなのか、どの部分を確認したら良いか分かりませんでした。
「cat Gemfile.lock」をターミナルで実行してVSCode内のコードとバージョンの比較をしましたが相違ありませんでした。
初心者で不足している情報があるかもしれませんのでそちらもお教えいただきたいです。

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

ここにより詳細な情報を記載してください。

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

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

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

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

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

guest

回答1

0

自己解決

gem list bundler

をターミナルで実行し、bundlerのバージョンを確認

*** LOCAL GEMS *** bundler (2.5.1, 2.4.1)

食い違いがあったことが原因だったようでした。

rm -rf $(gem environment gemdir)/specifications/default ; rm -rf Gemfile.lock ; bundle install ;

をターミナルで実行し、bundlerを確認

gem list bundler

をターミナルで実行し、bundlerのバージョンを確認

*** LOCAL GEMS ***

削除できた。

gem install bundler -v 2.4.1

上記で再度インストールし直し、renderでアプリを作成し直したところ正常にできました。

投稿2023/12/17 06:40

K-Yama

総合スコア1

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.31%

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

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

質問する

関連した質問