1
votes

I do have a problem with bundler install for the gem 'factory_girl_rails' and I don't know how to resolve.

Each time I run bundle install in the application/project directory the following error is thrown:
(it doesn't matter if I create a new rails app and add factory_girl to the gemfile either)

Gem::InstallError: factory_girl requires Ruby version >= 1.9.2.

An error occured while installing factory_girl (4.1.0), and Bundler cannot continue.

Make sure that gem install factory_girl -v '4.1.0' succeeds before bundling.

When I type 'gem intall factory_girl_rails' in the terminal it successfully installs.

My configuration:

osx mountain lion
ruby 1.9.3p286
gem 1.8.24
rails 3.2.8

which ruby:
/usr/local/bin/ruby

which gem:
/usr/local/bin/gem

which rails:
/usr/local/bin/rails

gem list:
*** LOCAL GEMS ***

actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activeresource (3.2.8)
activesupport (3.2.8)
addressable (2.3.2)
arel (3.0.2)
bcrypt-ruby (3.0.1)
best_in_place (1.1.2)
bigdecimal (1.1.0)
builder (3.1.4, 3.0.4)
bundler (1.2.1)
cancan (1.6.8)
capybara (1.1.2)
carrierwave (0.7.0)
childprocess (0.3.6)
client_side_validations (3.2.1)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0, 1.3.3)
country_select (1.0.1)
devise (2.1.2)
diff-lcs (1.1.3)
erubis (2.7.0)
evernote (1.2.1)
evernote-thrift (1.22.1)
execjs (1.4.0)
factory_girl (4.1.0)
factory_girl_rails (4.1.0)
faraday (0.8.4)
ffi (1.1.5)
geocoder (1.1.4)
guard (1.4.0)
guard-rspec (2.1.0)
hashie (1.2.0)
hike (1.2.1)
httpauth (0.2.0)
i18n (0.6.1)
io-console (0.3)
journey (1.0.4)
jquery-rails (2.1.3)
json (1.7.5)
jwt (0.1.5)
libwebsocket (0.1.5)
listen (0.5.3)
mail (2.4.4)
metaclass (0.0.1)
mime-types (1.19)
minitest (4.1.0)
mocha (0.12.7)
multi_json (1.3.7, 1.3.6)
multipart-post (1.1.5)
nested_form (0.2.3)
nifty-generators (0.4.6)
nokogiri (1.5.5)
oauth (0.4.7)
oauth2 (0.8.0)
omniauth (1.1.1)
omniauth-dropbox (0.2.0)
omniauth-evernote (1.2.0)
omniauth-facebook (1.4.1)
omniauth-foursquare (0.0.8)
omniauth-google (1.0.2)
omniauth-google-oauth2 (0.1.13)
omniauth-instagram (1.0.0)
omniauth-linkedin (0.0.8)
omniauth-oauth (1.0.1)
omniauth-oauth2 (1.1.1)
omniauth-salesforce (1.0.3)
omniauth-twitter (0.0.13)
omniauth-windowslive (0.0.8.1)
omniauth-xing (0.1.3)
omniauth-yahoo (0.0.4)
orm_adapter (0.4.0)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-protection (1.2.0)
rack-ssl (1.3.2)
rack-test (0.6.2)
rails (3.2.8)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
redis (3.0.2)
rmagick (2.13.1)
rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.3)
rspec-mocks (2.11.3)
rspec-rails (2.11.4)
rubygems-update (1.8.24)
rubyzip (0.9.9)
sass (3.2.2, 3.2.1)
sass-rails (3.2.5)
selenium-webdriver (2.25.0)
simple_form (2.0.4)
sinatra (1.3.3)
sprockets (2.8.0, 2.1.3)
sqlite3 (1.3.6)
thor (0.16.0)
thrift (0.9.0)
thrift_client (0.8.2)
tilt (1.3.3)
treetop (1.4.12, 1.4.11)
tzinfo (0.3.35, 0.3.34, 0.3.33)
uglifier (1.3.0)
warden (1.2.1)
xpath (0.1.4)

Content of the Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.8'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'



# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'


group :test, :development do
  gem 'aruba'
  gem 'cucumber'
  gem 'rspec-rails'
  gem 'mongoid-rspec'
  gem 'capybara'
  gem 'database_cleaner'
  gem 'jasmine'
  gem 'factory_girl_rails'
end


# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

gem 'devise'
gem 'mongoid'
gem 'mongoid_spacial'
gem 'haml'
gem 'bson_ext'
gem 'rails-backbone'
2

2 Answers

0
votes

Remove the Gemfile.lock file, and run bundle install again. Or run bundle update. Ref: Bundle says gem is missing - but it's not?

0
votes

Cracked it!

I have to "update" bundler.

I issued the following command: gem install bundler

The following messages is shown: Successfully installed bundler-1.2.1

After that I restarted terminal and again issued the "bundle install" command in the application/projects directory.

Now factory_girl and factory_girl_rails installed successfully! :-)

Source: gembundler.com