当我使用命令规范path / to / spec_file.rb时,它会出现以下消息。因为我使用RVM(Rail 3和Ruby 1.9.2),我不确定我的RSpec或我的ROR有什么问题
/var/www/resource_mapper_spike/config/boot.rb:3: uninitialized constant YAML::ENGINE (NameError)
from /var/www/resource_mapper_spike/config/application.rb:1:in `require'
from /var/www/resource_mapper_spike/config/application.rb:1
from /var/www/resource_mapper_spike/config/environment.rb:2:in `require'
from /var/www/resource_mapper_spike/config/environment.rb:2
from /var/www/resource_mapper_spike/spec/spec_helper.rb:3:in `require'
from /var/www/resource_mapper_spike/spec/spec_helper.rb:3
from ./spec/models/layer_spec.rb:1:in `require'
from ./spec/models/layer_spec.rb:1
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:15:in `load'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:15:in `load_files'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:14:in `each'
from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:14:in `load_files'
from /usr/lib/ruby/1.8/spec/runner/options.rb:134:in `run_examples'
from /usr/lib/ruby/1.8/spec/runner/command_line.rb:9:in `run'
from /usr/bin/spec:3
答案 0 :(得分:0)
我刚发现我的命令有问题。 spec命令只能在rails 2上运行,但在rails 3中我必须使用命令rspec