Daisuke Ishii February 2016

Ruby 2.3.0 gem pg version 0.18.4 install error El Capitan

After "bundle install", I keep getting this error for many times.

Errno::EACCES: Permission denied @ rb_sysopen - /Users/daisukeishii/tasca-     io/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4/.gemtest

An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
  • gem install pg keeps giving the same error -ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15] -psql (PostgreSQL) 9.5.0 -Mac El Capitan -I checked all related posts in stackoverflow but could not solve this.
  • Tried to uninstall/install PostgreSQL through brew.
  • Tried to uninstall/install Ruby

Do you have any idea to solve this?

Answers


Kimmo Lehto February 2016

I had problems installing the pg gem and for me this did the trick:

ARCHFLAGS="-arch x86_64" gem install pg

However, looking at your error message it actually seems to be about not having write permissions to the gem directory. Maybe you have tried to install the gem as root with sudo gem install pg and it left behind a directory under your home directory having root as owner instead of your regular user.

Remove the directory using:

sudo rm -rf /Users/daisukeishii/tascaio/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4

And then try installing again using the ARCHFLAGS above.

Note that your post has some sort of copy paste problem in the path so the path in this example might not be correct.

Post Status

Asked in February 2016
Viewed 2,446 times
Voted 14
Answered 1 times

Search




Leave an answer