Ruby on rails Rails 3.1.1测试:Ruby 1.9.3上的基准测试
我正在尝试使用raketest:benchmark与Rails 3.1.1和Ruby 1.9.3进行测试 我已经尝试过最新的rake版本:gem'rake',“~>0.9.3.beta.1” 官方和建议的ruby prof gem:gem'ruby prof',:git=>'https://github.com/wycats/ruby-prof.git" 但我总是犯这样的错误:Ruby on rails Rails 3.1.1测试:Ruby 1.9.3上的基准测试,ruby-on-rails,ruby-1.9.3,Ruby On Rails,Ruby 1.9.3,我正在尝试使用raketest:benchmark与Rails 3.1.1和Ruby 1.9.3进行测试 我已经尝试过最新的rake版本:gem'rake',“~>0.9.3.beta.1” 官方和建议的ruby prof gem:gem'ruby prof',:git=>'https://github.com/wycats/ruby-prof.git" 但我总是犯这样的错误: rake test:benchmark /usr/local/rvm/rubies/ruby-1.9.3-p0/lib
rake test:benchmark
/usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: --benchmark (ArgumentError)
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:21:in `run'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
from /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
rake aborted!
Command failed with status (1): [/usr/local/rvm/rubies/ruby-1.9.3-p0/bin/ru...]
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/test_unit/testing.rake:26:in `block (2 levels) in define'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/test_unit/testing.rake:11:in `block in define'
Tasks: TOP => test:benchmark
(See full trace by running task with --trace)
这在我的ubuntu服务器和windows开发环境中都会发生。有什么想法吗
更新:我安装了RVM并使用ruby 1.9.2进行了尝试:它可以工作。在其他条件不变的情况下,切换到1.9.3会出现错误。这可能是ruby 1.9.3或rails/rake等中的一个bug。您是否尝试过使用
bundle exec运行
$ bundle exec rake test:benchmark
您需要安装测试单元Gem。参见谢谢你的建议,我试过了,但最终结果是一样的。我也试着用RVM来使用1.9.2,其他的都一样,它是有效的。谢谢你,我会在有机会的时候试试这个。