2013-07-07 29 views
0

我使用Ubuntu 12.04 64位。我只是重新安裝了操作系統,並用RVM安裝了Ruby/Rails。但是,當我嘗試運行Rspec的測試中,我得到一個錯誤:'要求':沒有這樣的文件加載 - spec_helper

ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- spec_helper (LoadError) 

我產生與命令spec_helper文件:rails g rspec:install

我有spec目錄下的文件spec_helper。 有誰知道它爲什麼不工作?

只有當我運行從崇高的文本2測試中,我已經在這個環節添加的測試,如出現錯誤:https://github.com/maltize/sublime-text-2-ruby-tests

我的Gemfile:

source 'https://rubygems.org' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.0.0' 

# Use sqlite3 as the database for Active Record 
gem 'sqlite3' 

# Use SCSS for stylesheets 
gem 'sass-rails', '~> 4.0.0' 
gem 'rspec-rails' 

# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 

# Use CoffeeScript for .js.coffee assets and views 
gem 'coffee-rails', '~> 4.0.0' 

# See https://github.com/sstephenson/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks' 

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 1.2' 

group :doc do 
    # bundle exec rake doc:rails generates the API under doc/api. 
    gem 'sdoc', require: false 
end 

# Use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Use Capistrano for deployment 
# gem 'capistrano', group: :development 

# Use debugger 
# gem 'debugger', group: [:development, :test] 
+0

在普通規格文件夾的子目錄中是否有任何spec文件,或者是否有其他可能與您的spec目錄佈局有關的異常? – mckeed

+0

我生成的集成測試,試圖運行,並在崇高得到這個錯誤。當我從命令行運行rspec spec時,測試工作正常!但他們不在Sublime中工作,我不知道爲什麼。 – Karlis

+0

你看過附加功能部分並嘗試過這些設置嗎? https://github.com/maltize/sublime-text-2-ruby-tests#additional-features – FluffyJack

回答

相關問題