【问题标题】:Unable to install specific gem无法安装特定的 gem
【发布时间】:2012-05-25 21:08:16
【问题描述】:

我有一个现有的 Ruby On Rails 项目,我正在尝试启动并运行,但是当我尝试迁移数据库时,它说:

$ rake db:migrate 

Could not find json-1.6.5 in any of the sources

当我尝试安装特定的 gem 时,它失败了!

$ 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/ruby-1.9.2-p136@rails3/gems/json-1.6.5 for inspection.
Results logged to /Users/dev/.rvm/gems/ruby-1.9.2-p136@rails3/gems/json-1.6.5/ext/json/ext/parser/gem_make.out

【问题讨论】:

    标签: ruby-on-rails macos sqlite


    【解决方案1】:

    我觉得你需要为ruby安装系统依赖包libjson-ruby。安装此包将解决此错误。

    【讨论】:

    • 试过 gem install libjson-ruby,没有找到。当我用谷歌搜索它时——它看起来像是 Debian 的瑰宝。我正在运行 Mac。当我执行 gem list --remote json 时,没有什么叫做 libjson-ruby
    【解决方案2】:

    您似乎缺少一些命令行工具。

    确认你已经安装了make

    $ 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-28
      • 2013-02-20
      • 2017-06-07
      • 2012-03-25
      • 2014-02-22
      • 2015-03-16
      • 2011-08-16
      相关资源
      最近更新 更多