2012-11-09 35 views
1

以下是錯誤消息:bson_ext 1.7.0失敗使用捆綁時,在Linux上構建:安裝Capistrano的任務

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

/usr/local/bin/ruby extconf.rb 

Gem files will remain installed in /var/www/app_dir/shared/bundle/ruby/1.8/gems/bson_ext-1.7.0 for inspection. 
Results logged to /var/www/app_dir/shared/bundle/ruby/1.8/gems/bson_ext-1.7.0/ext/cbson/gem_make.out 
An error occured while installing bson_ext (1.7.0), and Bundler cannot continue. 
Make sure that `gem install bson_ext -v '1.7.0'` succeeds before bundling. 

我試圖運行gem install bson_ext -v '1.7.0'這種成功沒有任何錯誤。我試過安裝ruby-devruby1.8-dev apt包,這沒有幫助。

bundle install能夠成功地建立bson_ext在我的Mac OS X開發系統,但即使我直接運行它capistranobundle:install任務的上下文之外的Linux的生產環境中失敗。

我也嘗試運行gem update --systemgem update bundler,這並沒有幫助。

我懷疑問題在於如何在目標系統上調用bundle install。不過,我試着將Capistrano更新到2.13.5版,這並沒有幫助。

+0

日誌文件中是什麼? /var/www/app_dir/shared/bundle/ruby/1.8/gems/bson_ext-1.7.0/ext/cbson/gem_make.out – encoded

+0

只需行'/ usr/local/bin/ruby​​ extconf.rb'而不是其他任何東西。 – jkndrkn

回答

1

所以,看來bundler 1.2.1是無法建立我的系統上執行以下寶石:

  • bson_ext 1.7.0
  • curb 0.8.3
  • nokogiri 1.5.5
  • json 1.7.5
  • therubyracer 0.8.2。

我能夠使用gem install <GEMNAME> -v '<VERSION>' --install-dir /var/www/<APP_DIR>/shared/bundle/ruby/1.8/建立這些。之後,運行bundle exec capistrano deploy成功。

bundle似乎無法在我的系統上使用原生擴展創建寶石。不知道爲什麼,但也許這個程序將幫助那些有類似問題的人。

相關問題