我正在關注ruby on rails tutorials 3.2 by Michael Hartl,但是當我將gem 'factory_girl_rails', '1.4.0'
放入我的gemfile並運行bundle install
時,它顯示「bundle complete」,因爲gem已經加載到我的PC中。我的問題是它不是在spec文件夾中生成factories.rb
文件。出了什麼問題?Factories.rb文件未加載
Gemfile
:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.9.0'
gem 'annotate', '~> 2.4.1.beta'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.0'
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '1.4.0'
end
group :production do
gem 'pg', '0.12.2'
end
routes.rb
:
SAMPLEApp::Application.routes.draw do
resources :users
root to: 'static_pages#home'
match '/signup', to: 'users#new'
match '/help', to: 'static_pages#help'
match '/about', to: 'static_pages#about'
match '/contact', to: 'static_pages#contact'
end
非常感謝你霍爾格就來回編輯 –
沒有什麼可擔心的傢伙,我只是整理出錯誤 –