Q:

no such file to load -- factory_girl

I'm trying to upgrade Redmine to 1.2.1. When executing bundle exec rake db:migrate RAILS_ENV=production I got this error :
no such file to load -- factory_girl
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require'
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require'
/usr/local/redmine-1.2.1/vendor/plugins/redmine_import_from_csv/test/factories.rb:1
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require'
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require'
/usr/local/redmine-1.2.1/vendor/plugins/redmine_import_from_csv/init.rb:4:in `evaluate_init_rb'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/rails/plugin.rb:158:in `evaluate_init_rb'
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/rails/plugin.rb:154:in `evaluate_init_rb'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/rails/plugin.rb:48:in `load'
/usr/local/redmine-1.2.1/config/../vendor/plugins/engines/lib/engines/plugin.rb:44:in `load'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:38:in `load_plugins'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `each'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `load_plugins'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/initializer.rb:369:in `load_plugins'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/initializer.rb:165:in `process'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
/usr/local/redmine-1.2.1/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
/usr/local/redmine-1.2.1/config/environment.rb:20
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:547:in `new_constants_in'
/usr/local/redmine-1.2.1/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in `require'
/usr/local/redmine-1.2.1/vendor/rails/railties/lib/tasks/misc.rake:4
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:174:in `each'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/gems/rake-0.9.2/bin/rake:32
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/bin/rake:19:in `load'
/usr/local/redmine-1.2.1/vendor/bundle/ruby/1.8/bin/rake:19
Tasks: TOP => db:migrate => environment

I tried to add factory_girl in Gemfile and execute bundle install --path vendor/bundle
I got another error :
Could not find gem 'factory_girl (~> 2.0.1, runtime)' in any of the gem sources listed in your Gemfile.

Here is the Gemfile:
source "http://rubygems.org"
gem "rails", "2.3.11"
gem "rack", "1.1.1"
gem "i18n", "0.4.2"
gem "rubytree"
gem "coderay",  "~> 0.9.7"
gem "mysql"
gem "factory_girl"

What should I do?

A:

I think you need to use factory_girl version 1.2.4, so change this in your Gemfile:
gem 'factory_girl', '1.2.4'

This is on the README for version 1.3.3:
"If you want to use factory_girl with Rails versions prior to Rails 3, use version 1.2.4."

