首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >服务器安装陷入错误:无法在任何源(Bundler::GemNotFound)中找到pg-0.17.1

服务器安装陷入错误:无法在任何源(Bundler::GemNotFound)中找到pg-0.17.1
EN

Stack Overflow用户
提问于 2014-04-29 04:27:24
回答 1查看 1.7K关注 0票数 2

试图让Ruby2.0.0在CentOS 6.5上运行,并使用nginx和客运。到目前为止,由于错误而没有运气:http://prntscr.com/3egoca

这是我用于安装用于Ruby的PostgreSQL服务器的过程:

代码语言:javascript
复制
sudo vi /etc/yum.repos.d/CentOS-Base.repo

# In both [base] and [updates] sections I added the following line to the file above:
# exclude=postgresql*

sudo rpm -Uvh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
sudo yum install postgresql93 postgresql93-devel postgresql93-server postgresql93-libs postgresql93-contrib
sudo /etc/init.d/postgresql-9.3 initdb
sudo service postgresql-9.3 start
sudo chkconfig --levels 235 postgresql-9.3 on

# At the bottom of this file I changed authentication method to md5:
sudo vi /var/lib/pgsql/9.3/data/pg_hba.conf
sudo service postgresql-9.3 restart

到目前为止,在测试时,PostgreSQL运行得很好,但这是它失败的地方:

代码语言:javascript
复制
bundle install

这给了我一个错误:

代码语言:javascript
复制
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/home/deploy/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

因此,我遵循了这个建议,尝试分别安装PG宝石,如下所示:

代码语言:javascript
复制
gem install pg -- --with-pg-config=/usr/pgsql-9.3/bin/pg_config

当我尝试的时候,我得到了这个输出:

代码语言:javascript
复制
Building native extensions with: '--with-pg-config=/usr/pgsql-9.3/bin/pg_config'
This could take a while...
Successfully installed pg-0.17.1
invalid options: -f fivefish
(invalid options are ignored)
Parsing documentation for pg-0.17.1
unable to convert "\xF0" from ASCII-8BIT to UTF-8 for ../../extensions/x86_64-linux/2.0.0/pg-0.17.1/pg_ext.so, skipping
unable to convert "\xF0" from ASCII-8BIT to UTF-8 for lib/pg_ext.so, skipping
1 gem installed

尽管说它安装成功,但我还是收到了我发布的截图中的乘客错误,我仍然无法让bundle install成功运行。

顺便说一句,我是SSH作为用户“部署”,这也是nginx在nginx.conf文件中设置的用户。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-29 04:34:55

尝试:

代码语言:javascript
复制
export PATH=/usr/pgsql-9.3/bin:$PATH
bundle install
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23355477

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档