简体   繁体   English

Ruby 2.3.0 gem pg版本0.18.4安装错误El Capitan

[英]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. gem install pg不断给出相同的错误-ruby 2.3.0p0(2015-12-25修订版53290)[x86_64-darwin15] -psql(PostgreSQL)9.5.0 -Mac El Capitan-我检查了stackoverflow中的所有相关帖子,但无法解决这个。
  • Tried to uninstall/install PostgreSQL through brew. 尝试通过brew卸载/安装PostgreSQL。
  • Tried to uninstall/install Ruby 尝试卸载/安装Ruby

Do you have any idea to solve this? 您有解决的办法吗?

I had problems installing the pg gem and for me this did the trick: 我在安装pg gem时遇到了问题,这对我来说很成功:

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. 但是,查看您的错误消息实际上似乎与没有对gem目录的写权限有关。 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. 也许您已尝试使用sudo gem install pg将root作为root sudo gem install pg并将其留在主目录下的目录中,该目录具有root作为所有者,而不是常规用户。

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. 然后尝试使用上面的ARCHFLAGS重新安装。

Note that your post has some sort of copy paste problem in the path so the path in this example might not be correct. 请注意,您的帖子在路径中存在某种复制粘贴问题,因此此示例中的路径可能不正确。

In my case, the pg gem was looking for a PostgreSQL installation in the wrong place, so I runned 就我而言, pg gem在错误的位置寻找PostgreSQL安装,所以我运行了

bundle config build.pg --with-pg-config=/usr/local/Cellar/postgresql/9.4.5/bin/pg_config

which was where my PostgreSQL installation actually was, and then 这实际上是我的PostgreSQL安装所在的位置,然后

bundle install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM