![](/img/trans.png)
[英]Cannot run Bundle Install on Mac OS Mountain Lion due to JSON v(1.7.3) gem error
[英]Ruby bundle install error with json-1.7.3
我在安裝ruby gems時遇到以下錯誤。 我正在使用Ubuntu
Installing json (1.7.3) 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:1:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.7.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.7.3/ext/json/ext/parser/gem_make.out
An error occured while installing json (1.7.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.3'` succeeds before bundling.
我剛看到這個鏈接,不知道如何處理ubuntu上的devkit * .exe文件。
您缺少ruby-dev或ruby-1.9-dev軟件包, 如此stackoverflow問題中所述 。 首先安裝開發包文件,然后嘗試安裝gem。
我遇到了同樣的問題,這些修復都沒有奏效。
這是有效的。 似乎Ubuntu的.bashrc在頂部附近有這條線:
# If not running interactively, stop here.
[ -z "$PS1" ] && return
正如評論所暗示的那樣,這就止於此。 Capistrano以非交互方式執行命令,因此當它運行.bashrc時,文件的其余部分永遠不會被獲取。
我的RVM線路低於此值,因此沒有正確設置環境以便capistrano捆綁。
這些行應該高於上一行:
[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"
希望這有助於某人。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.