ruby-on-rails – 使用Ubuntu的pg gem
发布时间:2020-12-17 02:03:19 所属栏目:百科 来源:网络整理
导读:我正在尝试使用新的rails应用程序安装pg gem,但我一直收到同样的错误: Building native extensions. This could take a while...ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/arthur/.rvm/rubies/ruby-1.9.2-p320/bin/
我正在尝试使用新的rails应用程序安装pg gem,但我一直收到同样的错误:
Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/arthur/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb --with-pg-lib=/usr/lib checking for pg_config... yes Using config values from /usr/bin/pg_config checking for libpq-fe.h... yes checking for libpq/libpq-fs.h... yes checking for pg_config_manual.h... yes checking for PQconnectdb() in -lpq... no checking for PQconnectdb() in -llibpq... no checking for PQconnectdb() in -lms/libpq... no Can't find the PostgreSQL client library (libpq) *** 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. 我已经尝试过这个问题:How to install PostgreSQL’s pg gem on Ubuntu? 顺便说一句,这是ruby1.9.2和Rails 3.2. 谢谢 解决方法
安装postgresql 9然后安装你的gem.
sudo apt-get install postgresql libpq-dev 现在,跑 gem install pg 然后 捆绑安装 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |