2011-04-06 2 views
5

Je tente d'exécuter "bundle install". J'ai déjà installé le devkit Ruby et l'ai ajouté à mon chemin. Il se plaint de ne pas être une commande reconnue. N'est-ce pas ce que devkit est censé ajouter? Lors de la recherche de réponses à ce problème, chaque réponse semble être "installer devkit". Je suis sur Windows 7, quelle serait la manière la plus simple de configurer mon environnement pour lui permettre de créer des gemmes?L'installation de l'ensemble échoue en raison d'une commande make manquante

Je reçois la sortie suivante:

$ 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 

Répondre

14

La question était que j'ai installé dans DevKit autre chose que l'invite de commandes de Windows. Assurez-vous de l'utiliser. Si vous avez déjà essayé de l'installer avec autre chose, exécutez:

ruby dk.rb install --force 
-1

Vous devez vous assurer que vous avez gcc/g ++ et de faire installer. Ruby est construit sur C donc vous aurez besoin du compilateur C (qui utilise make) pour s'assurer que tout fonctionne correctement.

Tips for how to install GCC

+1

Il utilise Windows, ces étapes s'appliquent pour Linux . –

0

J'ai rencontré le même problème. Après avoir lutté pendant un certain temps, j'ai redémarré Windows et les problèmes ont été résolus magiquement.

-1

EDIT: NOTE: Les étapes ci-dessous sont pour linux et j'ai seulement pris le temps d'y répondre car il est apparu sur google comme première réponse et je pense que cela pourrait aider quelqu'un d'autre. La réponse de Windows est déjà donnée et déjà sélectionnée comme la bonne.

===

j'ai eu le même problème dans linux lorsque vous essayez d'installer rails après l'installation rubis.

Quand j'ai installé ruby ​​l'une des dépendances est gcc qui vous fera penser faire l'est également.

Il suffit d'aller de l'avant et faire installer: sudo apt-get install make ou si vous êtes comme moi et ne veulent pas rencontrer des problèmes à nouveau il suffit d'exécuter: sudo apt-get install build-essential pour couvrir tout :)

Questions connexes