我正在尝试编写一个 rake 任务,该任务将设置一个反映我的项目的环境。
task :environment do
require 'rubygems'
require 'sequel'
# require 'my_projects_special_files'
end
task :foo => [:environment] do
require 'irb'
IRB.start
end
导致 irb 抱怨“foo”不存在(任务名称)
10:28:01:irb_test >> rake foo --trace (在 /Users/mwlang/projects/personal/rake/irb_test) ** 调用 foo (first_time) ** 调用环境(first_time) ** 执行环境 ** 执行 foo 耙中止! 没有这样的文件或目录 - foo /opt/local/lib/ruby/1.8/irb/input-method.rb:68:in `initialize' /opt/local/lib/ruby/1.8/irb/input-method.rb:68:in `open' /opt/local/lib/ruby/1.8/irb/input-method.rb:68:in `initialize' /opt/local/lib/ruby/1.8/irb/context.rb:80:in `new' /opt/local/lib/ruby/1.8/irb/context.rb:80:in `初始化' /opt/local/lib/ruby/1.8/irb.rb:92:in `new' /opt/local/lib/ruby/1.8/irb.rb:92:in `初始化' /opt/local/lib/ruby/1.8/irb.rb:57:in `new' /opt/local/lib/ruby/1.8/irb.rb:57:in `start' /Users/mwlang/projects/personal/rake/irb_test/Rakefile:9