If you're updating Xcode, brew upgrade, etc.
This is a memo I was addicted to when I reinstalled from Ruby with rbenv because the Rails app that was working stopped working.
Since it stopped working at all, I deleted (renamed) Gemfile.lock as well.
| program | The version that was working | Stuck version | Current version |
|---|---|---|---|
| bundler | 1.13.2 | 2.2.3 | 1.13.2 |
| Ruby | 2.3.0 | 2.3.0 | 2.3.0 |
| Rails | ~> 4.2 | ~> 4.2 | ~> 4.2 |
| PostgreSQL | 11 | 13 | 13 |
| Xcode | 11.x | 12.3 | 12.3 |
bundler installation procedure (stuck version)% rbenv uninstall 2.3.0
% rbenv install 2.3.0
% gem install bundler #← Because an error will occur if you renew rubygems
% gem update --system
% gem install bundler
% cd MY_PROJECT
% bundle install --path vendor/bundle #← Error due to different version of budler
Then install the old bundler and it will be fine
% gem install bundler -v 1.13.2
After all it is an error due to the version difference, so take a look at gem
% gem list "^bundler$"
*** LOCAL GEMS ***
% bundler (default:2.2.3, 1.13.2)
I tried various things by referring to the links below, but I couldn't solve it at all. .. ..
(Rather, bundle stopped working)
How to change Bundler default version
bundler again (version error itself resolved)% rbenv uninstall 2.3.0
% rbenv install 2.3.0
% gem install bundler -v 1.13.2 #Specify from the beginning
% cd MY_PROJECT
% bundle install #← Error in bundle is resolved
The error was resolved.
The function name may be different, but it happened quite often. The cause seems to be stricter when using Xcode 12.
~snip~
Call.c:334:5: error: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
~snip~
There were many articles saying that it is okay to use old Xcode, but I was able to build it by executing the command referring to the following site. Postgresql gem install pg 0.18.4 passes, bundle install fails
bundle config build.pg '-- --with-cflags="-Wno-error=implicit-function-declaration"'
Similarly, puma, nokogiri, libxml, etc. may cause an error, but it seems to work if you add them as follows.
bundle config build.puma '-- --with-cflags="-Wno-error=implicit-function-declaration"'
I didn't understand the necessity of --. .. ..
(Excerpt)
Add `gem 'pg'` to your Gemfile and ensure its version is at the minimum required by ActiveRecord
I didn't specify the version, so pg 1.x was included.
Fixed Gemfile
gem 'pg'
↓
gem 'pg', '0.18.4'
Even though there is Gemfile.lock, you basically have to specify the version of the gem written in Gemfile. ..
Recommended Posts