Gem安装捆绑器&&捆绑安装错误

时间:2011-03-21 17:05:16

标签: ruby-on-rails ruby

我正在尝试使用以下内容安装gem:

gem install bundler && bundle install

它开始很好,但后来我得到一个错误(安装小黄瓜):

Successfully installed bundler-1.0.10
1 gem installed
Installing ri documentation for bundler-1.0.10...
Installing RDoc documentation for bundler-1.0.10...
Fetching source index for http://gemcutter.org/
Fetching source index for http://gems.github.com/
Using rake (0.8.7)
Using activesupport (2.3.5)
Using rack (1.0.1)
Using actionpack (2.3.5)
Using actionmailer (2.3.5)
Using activerecord (2.3.5)
Using activeresource (2.3.5)
Using authlogic (2.1.6)
Using builder (2.1.2)
Using haml (3.0.17)
Using compass (0.8.17)
Using crack (0.1.8)
Using diff-lcs (1.1.2)
Using trollop (1.16.2)

Installing gherkin (2.1.5) with native extensions /ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:482:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/ruby/bin/ruby extconf.rb

checking for main() in -lc... no

creating Makefile

make

sh: make: command not found

Gem files will remain installed in /ruby/lib/ruby/gems/1.8/gems/gherkin-2.1.5 for inspection.
Results logged to /ruby/lib/ruby/gems/1.8/gems/gherkin-2.1.5/ext/gherkin_lexer_ar/gem_make.out
/ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:445:in `each'
/ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:445:in `build_extensions'
/ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:197:in `install'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `run'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `send'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
/ruby/lib/ruby/gems/1.8/gems/bundler-1.0.10/bin/bundle:13
/ruby/bin/bundle:19:in `load'
/ruby/bin/bundle:19

4 个答案:

答案 0 :(得分:5)

$ sudo ln -s /bin/mkdir /opt/local/bin/gmkdir
$ sudo ln -s /usr/bin/install /opt/local/bin/ginstall

运行这些命令似乎对我有用。当我从macports切换到自制软件时,我遇到了这个问题。

答案 1 :(得分:1)

正如@groovetrain和@Augusto所说,你需要安装Apple的开发者工具。这些可以在操作系统安装盘上找到,也可以从Apple Developer Connection

下载

答案 2 :(得分:1)

好吧,我会说你只需要输入你的OS X cd并安装开发者工具。然后再次运行gem install bundler,看它是否有效!

答案 3 :(得分:1)

Make未安装或已卸载。如果您进行操作系统升级(例如从Lion到Mountain lion),通常会发生这种情况。

从这里下载最新的命令行工具:

https://developer.apple.com/downloads/index.action - 约100Mb

在终端类型:

make

你应该没有错误。最新的Presto!