I suffered from an error when executing the application creation command, so I will write down the solution as a memo for latecomers. If you want to get into the main subject right away, I recommend you to skip to the section'Installing libpq-fe.h'.
windows 10 home ubuntu 20.04 LTS ruby 2.7.1 Rails 6.0.3
As a deep digging order of the problem
rails new (app name) -d pstgresql
At
An error occurred during the installation of pg (1.2.3) and Bundler cannot continue.
Before bundling, make sure that gem install pg -v '1.2.3' --source' https: // ruby gems.org /'
is successful.
I got the error.
gem install pg -v '1.2.3'
Then, you will be instructed to look at the log because it remains in mkmf.lpg stored somewhere.
I found an error saying that libpq-fe.h was not found in the log contents. Since it is not possible to dig deeper any further, it is concluded that the true cause is that libpq-fe.h does not exist.
sudo apt install libpq-dev
In addition to the procedure that the Lord has solved, I will also list the methods that may be solved in some cases. It may be just that, so please forgive me even if I don't solve it. By the way, the Lord couldn't solve it with this.
Sudo apt-get install libpq-dev
sudo install postgresql-devel
sudo install postgresql
rails new (app name) -d pstgresql
Confirm that no error has occurred even if you execute. Judge that the problem has been resolved. In the case of the main, it was solved by method ①.
If you get to this article and just don't understand, ask for help in this article. Probably by that time, the Lord should have some knowledge, so I'm sure he can help.
Recommended Posts