0

Ubuntu 12.04 64 ビットを使用しています。OSを再インストールし、RVMでRuby/Railsをインストールしました。しかし、Rspec テストを実行しようとすると、エラーが発生します。

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]
4

1 に答える 1

1

コマンドラインから Sublime Text 2 を実行する

$ cd "to your app folder then"

$ subl .

これは機能するはずであり、 https://github.com/maltize/sublime-text-2-ruby-testsに注として記載されています

于 2013-09-24T06:01:59.263 に答える