简体   繁体   English

耙子无法启动

[英]Rake failing to start

I'm having trouble understanding the following error with Ruby's Rake. 我无法理解Ruby's Rake的以下错误。

C:\>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:\>rake
C:/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find executable r
ake for rake-0.8.7 (Gem::Exception)
        from C:/Ruby192/bin/rake:19:in `<main>'

Running Ruby 1.9.2 for Windows. 在Windows上运行Ruby 1.9.2。

Edit: Installing from source yields: 编辑:从源安装产生:

C:\Documents and Settings\XPherior\Desktop\rake-0.8.7\rake-0.8.7>ruby install.rb

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
ftools (LoadError)
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from install.rb:3:in `<main>'

The second error, where you have installed into C:\\Documenets And Settings\\ is occurring because you cannot install ruby into a folder with a space in the path. 由于无法将ruby安装到路径中带有空格的文件夹中,因此发生第二个错误,即您已安装到C:\\ Documenets And Settings \\的位置。 It should be installed into c:\\Ruby\\ c:\\Ruby#.#.#\\ if you want the version # in the path, or something along those lines. 如果要在路径中使用版本号或类似的名称,则应将其安装到c:\\ Ruby \\ c:\\ Ruby#。#。#\\中。

for the first error: there is a bug in the rubyinstaller.org version of ruby 1.9.2, which is causing this by running "gem install rake". 第一个错误:ruby 1.9.2的rubyinstaller.org版本中存在一个错误,这是通过运行“ gem install rake”引起的。

you can read about the error you're getting, here: http://redmine.ruby-lang.org/issues/show/3677 您可以在此处了解有关该错误的信息: http : //redmine.ruby-lang.org/issues/show/3677

there are a couple of ways to fix this error: 有两种方法可以解决此错误:

  • re-install ruby v1.9.2 and don't run "gem install rake". 重新安装ruby v1.9.2,不要运行“ gem install rake”。 rake v0.8.7 is built into the ruby v1.9.2 installation, so you don't need to re-install it. rake v1.9.2安装内置了rake v0.8.7,因此您无需重新安装它。
  • if you do want to manually install it, you can delete the ruby.gempspec file from your ruby installation. 如果确实要手动安装它,则可以从ruby安装中删除ruby.gempspec文件。 this file is located at (rubyinstalldir)\\lib\\ruby\\gems\\1.9.1\\specifications 该文件位于(rubyinstalldir)\\ lib \\ ruby​​ \\ gems \\ 1.9.1 \\ specifications

either of these options will fix the problem for you. 这些选项都可以为您解决问题。

i'm not sure which is "better" off-hand... it may be necessary to delete the gemspec file and reinstall rake, to support updates and new versions in the future. 我不确定哪个是“更好的”副手...可能有必要删除gemspec文件并重新安装rake,以支持将来的更新和新版本。 i'm not sure, though. 不过我不确定。 we'll find out once rake is updated and we need to install a new version. 我们会在rake更新后找出来,我们需要安装一个新版本。 or, perhaps, the issue will be fixed in the ruby installation by then, and we'll just need to update our ruby install. 或者,也许该问题将在那时的ruby安装中得到解决,而我们只需要更新ruby安装即可。

I've run into your both errors. 我遇到了您的两个错误。

For the first one. 对于第一个。 Try the solution post at here http://betterlogic.com/roger/2010/11/ruby-1-9-2-rake-woe/ . 在此处尝试解决方案发布, 网址为http://betterlogic.com/roger/2010/11/ruby-1-9-2-rake-woe/

And for the second error, it's causes by a library update by the ruby 1.9. 对于第二个错误,它是由ruby 1.9更新库引起的。 From the Programming Ruby 1.9 , " ftools have been removed (and replaced by fileutils). " I'm not pretty sure but at least that's an explanation. Programming Ruby 1.9中 ,“ ftools已被删除(并由fileutils代替。) ”我不太确定,但至少这是一个解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM