ruby-on-rails – Gem :: Installer :: ExtensionBuildError:ERROR:无法构建gem本机扩展ubuntu

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – Gem :: Installer :: ExtensionBuildError:ERROR:无法构建gem本机扩展ubuntu前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在运行捆绑安装时,我在’pg’gem中收到以下错误,我更改了gem作为sqlite,那么也会有相同的错误.这是我的错误信息.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:2:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/pg-0.16.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/pg-0.16.0/ext/gem_make.out

An error occurred while installing pg (0.16.0),and Bundler cannot continue.
Make sure that `gem install pg -v '0.16.0'` succeeds before bundling.

我试过apt-get安装libpg-dev gem安装pg -v’0.16.0’没有什么帮助我的

解决方法

我有同样的问题,我解决它通过安装在ubuntu作为普通用户不作为root用户.我希望这可以帮助你.

猜你在找的Ruby相关文章