新手问题 [已解决] spork 和 guard 都安装了用各种出错 ,在项目中怎样删除?

wgf4242 · 2013年08月29日 · 最后由 wgf4242 回复于 2013年08月29日 · 2687 次阅读

好像是改了 spec_helper.rb 中的一些代码。。 不知道怎么恢复。。

1.保留 spec_helper.rb 中

Spork.prefork do end

之间的代码,其余删除。

2.删除 Guardfile 文件 3.移除相关 gem,应该就可以了

#1 楼 @reyesyang 123 做完后,运行 rspec 进行测试。在 require 'rspec'这句出错。

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- rspec (LoadError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
        from C:/Sites/sample_app/spec/support/ultilities_spec.rb:1:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
        from C:/Sites/sample_app/spec/spec_helper.rb:9:in `block in <top (required)>'
        from C:/Sites/sample_app/spec/spec_helper.rb:9:in `each'
        from C:/Sites/sample_app/spec/spec_helper.rb:9:in `<top (required)>'
        from C:/Sites/sample_app/spec/requests/user_pages_spec.rb:1:in `require'
        from C:/Sites/sample_app/spec/requests/user_pages_spec.rb:1:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load_spec_files'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'

checkout . 呗

退回以前版本 发现就是 spec_helper.rb 多了这一行。 ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)

需要 登录 后方可回复, 如果你还没有账号请 注册新账号