2014-10-22 84 views
1

我試圖按照本教程http://code.tutsplus.com/tutorials/the-intro-to-rails-screencast-i-wish-i-had--net-22191來了解rails。rails生成失敗,因爲minitest

在我的gemfile中,我使用教程中的包添加了組開發和測試。

source 'https://rubygems.org' 


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.1.1' 
# Use sqlite3 as the database for Active Record 
gem 'sqlite3' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 4.0.3' 
# 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', '~> 2.0' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.0',   group: :doc 

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
gem 'spring',  group: :development 

# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

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

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

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

group :development, :test do 
    gem 'minitest-rails' 
    gem 'turn' 
    gem 'rspec-rails' 
    gem 'capybara' 
    gem 'guard-rspec' 
    gem 'growl_notify' 
end 

運行bundle update之後 - 這成功,我跑rails g,只得到這樣的:

$ rails g 
/usr/local/lib/ruby/gems/2.1.0/gems/minitest-5.4.2/lib/minitest/unit.rb:22:in `<class:Unit>': uninitialized constant Minitest::VERSION (NameError) 
    from /usr/local/lib/ruby/gems/2.1.0/gems/minitest-5.4.2/lib/minitest/unit.rb:21:in `<module:Minitest>' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/minitest-5.4.2/lib/minitest/unit.rb:20:in `<top (required)>' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/turn-0.9.6/lib/turn/minitest.rb:9:in `require' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/turn-0.9.6/lib/turn/minitest.rb:9:in `<top (required)>' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/turn-0.9.6/lib/turn.rb:13:in `require' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/turn-0.9.6/lib/turn.rb:13:in `<top (required)>' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `require' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `each' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:72:in `block in require' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `each' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler/runtime.rb:61:in `require' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.7.3/lib/bundler.rb:133:in `require' 
    from /Users/christietz/Documents/projects/tasks/config/application.rb:14:in `<top (required)>' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:82:in `require' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:82:in `preload' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `run' 
    from /usr/local/lib/ruby/gems/2.1.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>' 
    from /usr/local/Cellar/ruby/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /usr/local/Cellar/ruby/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from -e:1:in `<main>' 

我也嘗試添加gem minitest,而不是gem minitest-rails我的Gemfile。也不起作用。

回答

2

自從Minitest 5發佈以來,轉向寶石大多數爲abandoned,並且在夏季正式宣佈死亡。如果您正在尋找改進測試報告格式的替代方法,請嘗試查看minitest-reporters

相關問題