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

Yesterday I installed Ubuntu 16.04.1.

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

rails -v '4.2.6' create a rails project

run bundleand get an error message:

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.

At startup 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
+4
source share
2 answers

On Ubuntu you need to install the package sudo libpq-dev. Try the following:

sudo apt-get install libpq-dev

+15
source

This is a resolution issue. Try

sudo chown -R zeus ~/.rbenv

Here zeus is your username.

-2
source

Source: https://habr.com/ru/post/1659070/


All Articles