Rails rails spork 的坑

shallow__pace · 2013年06月27日 · 最后由 chunlea 回复于 2013年06月27日 · 3038 次阅读

安装rails tutorial的设置安装的spork,最后启动spork的时候死活启动不起来 报错如下:

Using RSpec
Preloading Rails environment
uninitialized constant ActiveModel::Observing (NameError)
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:56:in `preload_rails'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:7:in `preload'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/lib/spork/test_framework.rb:134:in `block in preload'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/lib/spork.rb:62:in `exec_prefork'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/lib/spork/test_framework.rb:120:in `preload'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:25:in `preload'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/lib/spork/runner.rb:74:in `run'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/lib/spork/runner.rb:10:in `run'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/gems/spork-0.9.2/bin/spork:10:in `<top (required)>'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/bin/spork:23:in `load'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/bin/spork:23:in `<main>'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval'
/home/sergio/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>'

real    0m1.925s
user    0m1.776s
sys 0m0.128s

看了下github,在gem中使用

gem 'spork-rails', github: 'railstutorial/spork-rails'

解决了。。又是坑

这个是版本兼容问题,也遇到过。

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