在 Ruby Rails 安装中找不到 rake
Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Windows\system32>gem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
C:\Windows\system32>rake
C:/Program Files (x86)/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can
't find executable rake for rake-0.8.7 (Gem::Exception)
from C:/Program Files (x86)/Ruby192/bin/rake:19:in `<main>'
C:\Windows\system32>
为什么我的系统找不到 rake 命令?我应该从哪里开始调试问题?
更新 1
我使用的是 ruby 1.9.2,并使用 Windows 版 ruby 安装程序 (http: //rubyinstaller.org/)
Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Windows\system32>gem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
C:\Windows\system32>rake
C:/Program Files (x86)/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can
't find executable rake for rake-0.8.7 (Gem::Exception)
from C:/Program Files (x86)/Ruby192/bin/rake:19:in `<main>'
C:\Windows\system32>
Why can't my system find the rake command? Where should I start debugging the problem?
Update 1
I'm using ruby 1.9.2 and installed it using the ruby installer for windows (http://rubyinstaller.org/)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此问题是Rake Ruby 1.9.2 捆绑版本的问题。您需要从 gem 规范文件夹中删除包含的
rake.gemspec
。请参阅 RubyInstaller 小组的此帖子,特别是此链接来自 Ruby-Forums 以获取解决方案。
顺便说一句:建议:避免将 Ruby 安装到带有空格的路径(程序文件)中。我预见您将来的安装会出现很多问题。
This issue is a problem of Ruby 1.9.2 bundled version of Rake. You will need to remove the included
rake.gemspec
from the gem specification folder.See this thread at RubyInstaller group, and specifically this link from Ruby-Forums for the solution.
BTW: a recommendation: avoid installing Ruby into path with spaces (Program Files). I forsee lot of problems with your installation in the future.
您无法将 Ruby(或 RubyGems)安装在带有空格的路径中。
You cannot install Ruby (or RubyGems) in a path with whitespace.
你的路径是什么样的?运行以下命令。
Windows 上的 Ruby 非常棘手。它并不完全是为这样的事情而设计的。人们安装 Ruby 的主要方式有三种。首先,他们下载直接的二进制文件并尝试将一些可行的东西组合在一起。其次,他们使用旧的一键安装程序。第三,他们使用新的 Ruby 安装程序。如果您还有其他东西,请将其扔掉并选择第三个选项。
What is your PATH like? Run the following command.
Ruby on Windows is very tricky. It's not exactly designed for something like this. There are three major ways people get Ruby installed. First, they download straight binaries and try to hack together something workable. Second, they use the old one-click installer. Third, they use the new Ruby installer. If you have anything else, get rid of it and go with the third option.