sudo gem install pg 不起作用
我正在尝试让 Rails 与 PostgreSQL 一起工作。显然,我一路上需要做的一件事是 sudo gem install pg 。当我这样做时,我得到了这个:
jason@buster:~/projects$ sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:2:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:2
Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.10.0 for inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.10.0/ext/gem_make.out
我已经用谷歌搜索并根据我发现的内容尝试了一些东西,但似乎没有任何帮助。有什么建议吗?我在Ubuntu上。
I'm trying to get Rails to work with PostgreSQL. Apparently one thing I need to do along the way is sudo gem install pg
. When I do that, I get this:
jason@buster:~/projects$ sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:2:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:2
Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.10.0 for inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.10.0/ext/gem_make.out
I've Googled and tried a few things based on what I've found but nothing seems to help. Any advice? I'm on Ubuntu.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要安装发行版 ruby-dev(或 devel)包,否则您将无法构建任何 ruby C 扩展。
我不在 ubuntu,但你的包管理器命令可能有点像这样:
You need to install your distro ruby-dev (or devel) package otherwise you won~t be able to build any ruby C extensions.
I'm not on ubuntu, but you package-manager command might be somewhat like this:
在Ubuntu上:
On Ubuntu: