2012-05-18 110 views
2

我有我試圖啓動和運行,但是當我嘗試遷移數據庫,它說的exsisting Ruby on Rails項目:無法安裝特定的寶石

$ rake db:migrate 

Could not find json-1.6.5 in any of the sources 

當我再嘗試安裝特殊的寶石,它失敗了!

$ gem install json -v '1.6.5' 

Fetching: json-1.6.5.gem (100%) 
Building native extensions. This could take a while... 
ERROR: Error installing json: 
     ERROR: Failed to build gem native extension. 

     /Users/dev/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb 
creating Makefile 

make 
sh: make: command not found 


Gem files will remain installed in /Users/dev/.rvm/gems/[email protected]/gems/json-1.6.5 for inspection. 
Results logged to /Users/dev/.rvm/gems/[email protected]/gems/json-1.6.5/ext/json/ext/parser/gem_make.out 

回答

0

我認爲你需要安裝系統相關的包libjson,紅寶石紅寶石。安裝這個軟件包將解決這個錯誤。

+0

試過gem install libjson-ruby,但沒有找到它。當我谷歌 - 它看起來像它是Debian的寶石。我正在運行Mac.And當我做一個寶石名單--remote json沒有任何東西叫做libjson-ruby – lmkk

2

它看起來像你缺少一些命令行工具。

驗證是否已安裝使

$ whereis make 

應該返回類似:

/usr/bin/make 

$ make -v 

應該類似於:

GNU Make 3.81 
Copyright (C) 2006 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. 
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE. 

This program built for i386-apple-darwin11.0 

如果你沒有看到類似的東西,也許你應該看看這個帖子https://stackoverflow.com/a/10217910/335523