我正在尝试按照本教程http://code.tutsplus.com/tutorials/the-intro-to-rails-screencast-i-wish-i-had--net-22191来理解rails。
在我的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中。也不起作用。
答案 0 :(得分:2)
自从Minitest 5发布以来,转弯宝石大多是abandoned,并且在夏季正式宣布死亡。如果您正在寻找改进测试报告格式的替代方案,请尝试查看minitest-reporters。