Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
791 views
in Technique[技术] by (71.8m points)

ruby on rails - Postgres - the last version 0.14.0 of the "pg" gem gives error

I have updated my bundler which contains pg gem and I got the error

An error occured while installing pg (0.14.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.0'` succeeds before bundling.

I have checked this gem on rubygems.org and today (June 23) was released this version. I don't know why, but the version doesn't works me correctly and return the error above.

The solution is set up the specific version - in this case

gem "pg", "~> 0.13.2"

Anyone with the same issue?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.

You don't need to specify a specific version of PG in your Gemfile

So :

sudo apt install ruby-dev libpq-dev build-essential

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...