2012-05-18 71 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