activesupport ruby 1.91 和 rake 的问题
我安装了 ruby 1.9.1
ruby 1.9.1p378 (2010-01-10 修订版 26273) [i386-mingw32]
当我尝试运行 rake 任务时出现错误:
rake aborted!
no such file to load -- ftools
C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
C:/Data/Checkouts/mvc2/Cms3/tools/rake/tasks.rb:4:in `<top (required)>'
C:/Data/Checkouts/mvc2/stonewarehouse/Rakefile.rb:5:in `require'
C:/Data/Checkouts/mvc2/stonewarehouse/Rakefile.rb:5:in `<top (required)>'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2017:in `block in load_rakefile'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2000:in `block in run'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
C:/Ruby/bin/rake:19:in `load'
C:/Ruby/bin/rake:19:in `<main>'
任何建议将不胜感激。
谢谢。
I have an installation of ruby 1.9.1
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]
when I try and run a rake task I am getting an error:
rake aborted!
no such file to load -- ftools
C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
C:/Data/Checkouts/mvc2/Cms3/tools/rake/tasks.rb:4:in `<top (required)>'
C:/Data/Checkouts/mvc2/stonewarehouse/Rakefile.rb:5:in `require'
C:/Data/Checkouts/mvc2/stonewarehouse/Rakefile.rb:5:in `<top (required)>'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2017:in `block in load_rakefile'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2000:in `block in run'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
C:/Ruby/bin/rake:19:in `load'
C:/Ruby/bin/rake:19:in `<main>'
any suggestions would be appreciated.
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题不在于 ActiveSupport。它出现在堆栈跟踪中只是因为它覆盖了内置的 Kernel#require 方法。
文件“Cms3/tools/rake/tasks.rb”在第 4 行有
require 'ftools'
,但 ftools 是 在 Ruby 1.9 中已弃用。修改这些任务以使用fileutils
代替,您就可以开始了。The problem is not in ActiveSupport. It appears in the stack trace simply because it overrides the builtin
Kernel#require
method.The file "Cms3/tools/rake/tasks.rb" has
require 'ftools'
on line 4, but ftools is deprecated in Ruby 1.9. Modify these tasks to usefileutils
instead and you'll be good to go.