安装pg(0.19.0)时发生错误,Bundler无法继续

时间:2021-03-22 23:09:53

Yesterday I install Ubuntu 16.04.1.

昨天我安装了Ubuntu 16.04.1。

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

ruby 2.3.1p112(2016-04-26修订版54768)[x86_64-linux]

rails -v '4.2.6' create a rails project

rails -v'4.2.6'创建一个rails项目

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'

运行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

2 个解决方案

#1


21  

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

在Ubuntu中,您需要安装libpq-dev软件包。试试这个:

sudo apt-get install libpq-dev

sudo apt-get install libpq-dev

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

对于CentOS 7,您需要安装postgresql-devel软件包。

sudo yum install postgresql-devel

sudo yum install postgresql-devel

#2


-2  

It is a permission issue. Try

这是一个许可问题。尝试

sudo chown -R zeus ~/.rbenv

Here zeus is your username.

这里zeus是你的用户名。

#1


21  

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

在Ubuntu中,您需要安装libpq-dev软件包。试试这个:

sudo apt-get install libpq-dev

sudo apt-get install libpq-dev

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

对于CentOS 7,您需要安装postgresql-devel软件包。

sudo yum install postgresql-devel

sudo yum install postgresql-devel

#2


-2  

It is a permission issue. Try

这是一个许可问题。尝试

sudo chown -R zeus ~/.rbenv

Here zeus is your username.

这里zeus是你的用户名。