问题
I'm setting up a ruby Apache Buildr on a fresh Windows 7 machine. I've installed Ruby, the DevKit and installed buildr via
gem install buildr
wich all ran perfect. Until I tried to execute buildr, then I get an error.
buildr compile
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find buildr (>= 0) amongst [atoulme-Antwrap-0.7.1, builder-2.1.2, buildr-1.4.5-x86-mswin32, buildr-as3-0.2.12, diff-lcs-1.1.2,highline-1.5.1, hoe-2.3.3, json_pure-1.4.3, minitar-0.5.3, minitest-1.6.0, net-sftp-2.0.4, net-ssh-2.0.23, rake-0.8.7, rdoc-2.5.8, rjb-1.3.2-x86-mswin32-60, rspec-2.1.0, rspec-core-2.1.0,rspec-expectations-2.1.0, rspec-mocks-2.1.0, rubyforge-2.0.3, rubygems-update-1.8.4, rubyzip-0.9.4, xml-simple-1.0.12] (Gem::LoadError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:1182:in `gem'
from C:/Ruby192/bin/buildr:18:in `<main>'
When I list all the gems with
gem list buildr
Everything seems to match up, and this error makes no sense at all.
Any ideas? Help would be great, I'm getting desperate now. :)
回答1:
Had the same problem. I have Windows 7 x64 so installed again with gem install buildr --platform mswin64
and it worked.
回答2:
I had a similar problem in the past.
My problem was the kind of installation. I installed ruby as admin (target was c:\program files). Everything worked fine - until I installed a gem as normal user (not admin).
What happened on windows side? I have no authorization for c:\program files, the gem was installed in another directory (No, there was no error, Windows just decided to use another directory. This bug/feature is called 'Virtual Store').
In the end Ruby had problems to find the files.
My solution: Install ruby as normal user outside c:\program files.
Maybe it is enough, when you install your gems as admin (but attention: if you have once files in your Virtual store, they are read always first.).
回答3:
Installed Ruby 1.8.7 instead and it works now.
来源:https://stackoverflow.com/questions/6191427/ruby-on-windows7-could-not-find-gem