我有一个spork宝石的问题。每次运行spork命令时,都会出现这个长错误:
evan@TheBeast-Computer:~/rails_projects/sample_app$ spork
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
cannot load such file -- /home/evan/rails_projects/sample_app/spec_helper (LoadError)
/home/evan/rails_projects/sample_app/spec/spec_helper.rb:57:in `require_relative'
/home/evan/rails_projects/sample_app/spec/spec_helper.rb:57:in `block in <top (required)>'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork.rb:24:in `prefork'
/home/evan/rails_projects/sample_app/spec/spec_helper.rb:6:in `<top (required)>'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `load'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `block in load'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `load'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork/test_framework.rb:138:in `block (2 levels) in preload'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork/app_framework/rails.rb:8:in `preload'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork/test_framework.rb:134:in `block in preload'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork.rb:62:in `exec_prefork'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork/test_framework.rb:120:in `preload'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:25:in `preload'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork/runner.rb:74:in `run'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/lib/spork/runner.rb:10:in `run'
/home/evan/.rvm/gems/ruby-1.9.3-p194/gems/spork-0.9.2/bin/spork:10:in `<top (required)>'
/home/evan/.rvm/gems/ruby-1.9.3-p194/bin/spork:23:in `load'
/home/evan/.rvm/gems/ruby-1.9.3-p194/bin/spork:23:in `<main>'
这是我的Gemfile文件:
source 'https://rubygems.org'
gem 'rails', '3.2.5'
gem 'sqlite3'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :development, :test do
gem 'rspec-rails', ">= 2.0.1"
end
group :test do
gem 'rspec-rails', '>= 2.0.1'
gem 'spork', '>= 0.8.4'
end
我不知道该怎么做或如何描述我的情况。但是我在《Ruby on Rails 3教程》书中看到的结果是:
$ spork
Using RSpec
Loading Spork.prefork block...
Spork is ready and listening on 8989!
chmod -R a+r
。 - duma$ ls -l vendor/bundle/ruby/2.1.0/gems/spork-1.0.0rc4/bin/
====-rwxr-xr-x 1 nthompson staff 460 9 Sep 15:27 spork
- Nick