2012-10-26 73 views
0

美好的一天。 我正在嘗試設置由其他人工作的項目。
當我運行bundle install它與一個錯誤bcrypt-ruby gem Gem :: Installer :: ExtensionBuildError:

Installing bcrypt-ruby (3.0.1) with native extensions 
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:36:in `<main>' 


Gem files will remain installed in /home/halfros/.bundler/tmp/9279/gems/bcrypt-ruby-3.0.1 for inspection. 
Results logged to /home/halfros/.bundler/tmp/9279/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out 
An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot continue. 
Make sure that `gem install bcrypt-ruby -v '3.0.1'` succeeds before bundling. 

sudo的創業板安裝崩潰bcrypt-紅寶石-v '3.0.1'

$ sudo gem install bcrypt-ruby -v '3.0.1' 
Building native extensions. This could take a while... 
ERROR: Error installing bcrypt-ruby: 
    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:36:in `<main>' 


Gem files will remain installed in /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.0.1 for inspection. 
Results logged to /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out 

嘗試的部份 - 沒有變化。
http://rorguide.blogspot.com/2011/02/bundle-install-on-linux-giving-error.html

+1

檢查了這一點:http://stackoverflow.com/questions/7645918/require-no-such-file-to-load-mkmf -loaderror –

回答

1

它看起來像沒有安裝ruby開發庫。

它看起來像你使用全局ruby/gems安裝,所以你最簡單的修復方法是安裝ruby1.9-dev包(或類似的東西),然後再試一次。

或者,你可以使用RVM而這個問題將解決自己:https://rvm.io/

+0

@上面的Jesse的鏈接包含這兩個答案。谷歌也一樣。 – jordanpg

+0

當我在谷歌找到它時沒有找到正確的答案。我使用rvm。 – Elmor

+0

你確定你沒有使用全局ruby安裝嗎? '哪個ruby'的輸出是什麼?如果您使用的是rvm,則構建過程中將包含devel includes。詳細瞭解如何編譯本機擴展:http://patshaughnessy.net/2011/10/31/dont-be-terrified-of-building-native-extensions – jordanpg

相關問題