2011-04-06 95 views
5

我試圖運行「bundle install」。我已經安裝了Ruby devkit,並將其添加到我的路徑中。它抱怨說不要成爲公認的命令。這不是什麼devkit應該添加?當搜索這個問題的答案時,每個答案似乎是「安裝devkit」。我在Windows 7上,配置我的環境以允許它構建寶石最簡單的方法是什麼?由於缺少make命令,bundle安裝失敗

我收到以下輸出:

$ bundle install 
Fetching source index for http://rubygems.org/ 
Using rake (0.8.7) 
Using activesupport (2.3.11) 
Using rack (1.1.0) 
Using actionpack (2.3.11) 
Using actionmailer (2.3.11) 
Using activerecord (2.3.11) 
Using activeresource (2.3.11) 
Using annotate (2.4.0) 
Using authlogic (2.1.6) 
Using columnize (0.3.2) 
Using haml (3.0.25) 
Using compass (0.10.6) 
Using configuration (1.2.0) 
Using daemons (1.0.10) 
Using declarative_authorization (0.5.2) 
Using delayed_job (2.0.7) 
Using i18n (0.5.0) 
Using faker (0.9.5) 
Using mocha (0.9.12) 
Using will_paginate (2.3.15) 
Using haml_scaffold (1.1.0) 
Installing json (1.4.6) with native extensions c:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 

c:/Ruby187/bin/ruby.exe extconf.rb 
checking for re.h... yes 
creating Makefile 

make 
'make' is not recognized as an internal or external command, 
operable program or batch file. 


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

的Gemfile:

source 'http://rubygems.org' 

gem 'rails', '2.3.11' 
gem 'paper_trail', '~> 1' 
gem 'will_paginate', '~> 2.3.11' 
gem 'paperclip', '~> 2.3' 
gem 'haml' 
gem 'compass', '>= 0.10.6' 
gem 'authlogic' 
gem 'declarative_authorization' 
gem 'delayed_job', '~> 2.0.4' 

group :development, :test do 
    gem 'heroku' 
    gem 'sqlite3' 
    gem 'heroku_san' 
    gem 'ruby-debug' 
    gem 'faker' 
    gem 'rcov' 
    gem 'annotate' 
    gem 'mocha' 
    gem 'haml_scaffold' 
end 

group :production do 
    # TODO 
end 

回答

14

的問題是我在比Windows命令提示符其他東西裝的devkit。確保你使用它。如果您已嘗試使用其他方式安裝它,請運行:

ruby dk.rb install --force 
-1

你需要確保你的gcc/g ++以及使安裝。 Ruby建立在C上,所以你需要C編譯器(它使用make)來確保一切正常運行。

Tips for how to install GCC

+1

他使用的是Windows,這些步驟適用於Linux 。 – 2011-04-06 06:17:40

0

我遇到了同樣的問題。

經過一段時間的苦苦掙扎後,我重新啓動了Windows,問題解決了神奇。

-1

編輯:注意:下面的步驟是爲linux我只花時間回答這個問題,因爲它作爲第一個響應在谷歌提出,我雖然可能會幫助別人。窗口答案已經給出,並已被選爲正確的答案。

===

我在linux下試圖安裝紅寶石後安裝時得到了同樣的問題。

當我安裝紅寶石依賴項之一是GCC這將讓你覺得使安裝爲好。

先走一步,安裝化妝:sudo apt-get install make,或者如果你像我一樣,不想碰到的問題只是再次運行:sudo apt-get install build-essential涵蓋了一切:)

相關問題