当我尝试在新生成的 rails 应用程序上运行“rake test”时,我收到以下错误
Computer:heroku user$ rake test:units
/Users/user
file doesnt exist
/Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require': cannot load such file -- /Users/user/test/unit/helpers/things_helper_test.rb (LoadError)
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `each'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `select'
from /Users/user/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [/Users/user/.rvm/rubies/ruby-1.9.3-p0/b...]
Tasks: TOP => test:units
(See full trace by running task with --trace)
我猜这与我的设置有关,因为似乎 rake 正在我的主目录而不是 rails 应用程序目录中寻找生成的文件。你能帮我指出我做错了什么吗?
我正在使用 Mac OS X Lion,安装了两个 ruby 版本(lion 附带 1.8.7,我用于应用程序的 1.9.3 已使用 rvm 安装)。
如果我运行“rails s”,应用程序就可以工作。
更新:如果我从头开始创建一个新的 rails 应用程序,只添加一个生成的脚手架,rake test 命令可以工作。因此,这可能是一个不兼容的问题,因为失败的 rails 应用程序是在另一台计算机上创建的,上传到 heroku,然后从那里克隆到一台新计算机。