我升级了ruby&今天铁路(2.2.0,4.2.1)。
在`app / test / models / user_test.rb'
require 'test_helper'
class UserTest < ActiveSupport:TestCase
test 'the truth' do
assert false
end
end
我跑了耙db:test:prepare
然后rake test
。
rake aborted!
NoMethodError: undefined method `ActiveSupport' for main:Object
/Users/quantum/sonar/app/test/models/user_test.rb:3:in `<top (required)>'
全新的Rails项目。我错过了什么?
app/test/testhelper:
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
end
答案 0 :(得分:0)
尝试使用此命令。希望它有所帮助。
rake db:migrate RAILS_ENV=test