Reputation: 209
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
Upvotes: 9
Views: 5917
Reputation: 376
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
Upvotes: 26
Reputation: 1
It is a permission issue. Try
sudo chown -R zeus ~/.rbenv
Here zeus is your username.
Upvotes: -2