ruby-on-rails - 无法安装特定的 gem

标签 ruby-on-rails macos sqlite

我有一个现有的 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

最佳答案

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

验证您是否已安装 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

关于ruby-on-rails - 无法安装特定的 gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10650135/

相关文章:

ruby-on-rails - Ruby on Rails - 在 Windows 上安装后无法识别捆绑命令

ruby-on-rails - Rails 3.1 事件管理、nested_form 和 link_to_add 不起作用

ruby-on-rails - 如何进行迁移以更新表 RAILS

ruby-on-rails - 搜索 "/"时出现 Thinking Sphinx 错误

macos - 带有 Intent 的 Mac 上的 WidgetKit 不起作用

objective-c - 在 Cocoa 中激活字体时从 NSFontManager 获取更新的 availableFonts

android - 在 Android 2.2 中复制 SQLite 数据库时出现问题

objective-c - Xcode - OSX 错误 : -fobjc-arc is not supported on platforms using the legacy runtime

c++ - sqlite3程序收到信号SIGSEGV,sqlite3_get_table()中出现段错误

mysql - SQLite 比 MySQL 快?