Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error occurred while installing pg (0.19.0), and Bundler cannot continue

Yesterday I install Ubuntu 16.04.1.

ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

rails -v '4.2.6' create a rails project

run bundle and have an error:

Errno::EACCES: Permission denied @ rb_sysopen - /home/zeus/.rbenv/versions /2.3.1/lib/ruby/gems/2.3.0/gems/pg-0.19.0/.gemtest
An error occurred while installing pg (0.19.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.19.0'` succeeds before bundling.

When run gem install pg -v '0.19.0'

ERROR:  While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /home/zeus/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pg-0.19.0/.gemtest
like image 954
Escobar Avatar asked Oct 27 '16 13:10

Escobar


1 Answers

In Ubuntu, You need to install libpq-dev package. Try this one:

sudo apt-get install libpq-dev

For CentOS 7, You need install postgresql-devel package.

sudo yum install postgresql-devel

like image 156
Олег Кулаков Avatar answered Nov 07 '22 03:11

Олег Кулаков