linux下 bundle install出错

haofly
  • 1.1k

成功执行完sudo gem install bundler后继续执行sudo bundle install出错,提示如下:

Fetching gem metadata from http://rubygems.org/.......
Fetching additional metadata from http://rubygems.org/..
Resolving dependencies...
Using rake (0.9.2.2)

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:inrequire'
from extconf.rb:1:in `

'

Gem files will remain installed in /var/lib/gems/1.9.1/gems/RedCloth-4.2.9 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/RedCloth-4.2.9/ext/redcloth_scan/gem_make.out
An error occurred while installing RedCloth (4.2.9), and Bundler cannot continue.
Make sure that gem install RedCloth -v '4.2.9' succeeds before bundling.

回复
阅读 11.3k
4 个回答
ly你个c
  • 956
✓ 已被采纳

推荐使用rvm或者rbenv安装ruby, 并且避免使用sudo.

Make sure that gem install RedCloth -v '4.2.9' succeeds before bundling.

所以就按照提示sudo gem install RedCloth -v '4.2.9'应该就可以了

你通过什么方式安装的ruby?检查一下ruby 的 dev 开发依赖有没有装上

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进