我试图让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
我已经Googled,并尝试了几件事情,基于我发现,但没有什么似乎有帮助.任何建议?我在Ubuntu
解决方法
您需要安装您的发行版ruby-dev(或devel)软件包,否则您将无法构建任何ruby C扩展.
我不是在ubuntu,但是你的package-manager命令可能有点像这样:
$sudo apt-get install ruby-dev build-essential