0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

rails s で An error occurred while installing pg (1.2.3), and Bundler cannot continue.が出た

Posted at

##概要
macを買い替え、以前のPCで技術書を参考に自作したアプリケーションを立ち上げようとrails s をしたら、表題のエラーが出た。

##開発環境
MacBook Pro (13-inch, M1, 2020)
macOS Big Sur バージョン 11.5.2

##rails sでエラーが出た

terminal
$ rails s
~
An error occurred while installing pg (1.2.3), and Bundler cannot
continue.
Make sure that `gem install pg -v '1.2.3' --source 'https://rubygems.org/'`
succeeds before bundling.

素直にやってみる。

terminal
$ gem install pg -v '1.2.3'
terminal
$ rails s
Ignoring bootsnap-1.7.3 because its extensions are not built. Try: gem pristine bootsnap --version 1.7.3
Ignoring bootsnap-1.7.1 because its extensions are not built. Try: gem pristine bootsnap --version 1.7.1
Ignoring bootsnap-1.5.1 because its extensions are not built. Try: gem pristine bootsnap --version 1.5.1
Ignoring eventmachine-1.0.9.1 because its extensions are not built. Try: gem pristine eventmachine --version 1.0.9.1
Ignoring ffi-1.14.1 because its extensions are not built. Try: gem pristine ffi --version 1.14.1
Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1
Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2
Ignoring msgpack-1.3.3 because its extensions are not built. Try: gem pristine msgpack --version 1.3.3
Ignoring nio4r-2.5.5 because its extensions are not built. Try: gem pristine nio4r --version 2.5.5
Ignoring nio4r-2.5.4 because its extensions are not built. Try: gem pristine nio4r --version 2.5.4
Ignoring sqlite3-1.4.0 because its extensions are not built. Try: gem pristine sqlite3 --version 1.4.0
Ignoring thin-1.8.0 because its extensions are not built. Try: gem pristine thin --version 1.8.0
Ignoring thin-1.5.1 because its extensions are not built. Try: gem pristine thin --version 1.5.1
=> Booting Puma
=> Rails 5.2.4.5 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.6 (ruby 2.6.6-p146), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop

一応サーバーは立ち上がったが、Ignoringが気になるので消したい。

$ gem install bundler
$ bundle install

で消えました。

##参考
https://tsubasa0105.hatenablog.com/entry/2018/11/29/180051
https://qiita.com/ROY_M/items/43fd1370e3d89ae50074
https://teratail.com/questions/139925

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?