Bundle says gem is missing - but it's not?

11,267

Solution 1

@jdoe answered in the comments. And it worked. Apparently I needed to delete Gemfile.lock.

I don't know why or how though. I am just posting this here, until @jdoe shows up and collects his points with a real answer.

Solution 2

Try reinstalling all the gems with the following command:

bundle install --redownload

Solution 3

Have you tried this?

bundle exec rails s
Share:
11,267
Andreas
Author by

Andreas

Updated on June 04, 2022

Comments

  • Andreas
    Andreas almost 2 years

    Background

    I am maintaining the content of a Ruby On Rails site, but I really have no experience with Rails.

    When trying to run the Rails server: rails s I get this:

    Could not find activesupport-3.2.0 in any of the sources

    Run bundle install to install missing gems

    I run bundle install

    Gem::InstallError: factory_girl requires Ruby version >= 1.9.2. An error occured while installing factory_girl (3.2.0), and Bundler cannot continue.

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

    Okay, I install factory_girl as per the instructions:

    Successfully installed factory_girl-3.2.0 1 gem installed

    Run bundle install again:

    Gem::InstallError: factory_girl requires Ruby version >= 1.9.2. An error occured while installing factory_girl (3.2.0), and Bundler cannot continue. Make sure that gem install factory_girl -v '3.2.0' succeeds before bundling.

    Do you have any idea?

    Info

    Yesterday I got a cross-tread error when trying to run rails server. So as per this SO advice I advice I've nuked RVM and installed rbenv and bundler instead of RVM.

    I have tried with both Ruby 1.9.3-p125 and 1.9.3-rc1

    Output of gem list shows factory_girl as installed.

    • ...
    • factory_girl (3.2.0)
    • ...

    Output of gem environmentshows the problem might has something todo with ruby 1.9.1 being installed also?

    RubyGems Environment:
    - RUBYGEMS VERSION: 1.8.10
    - RUBY VERSION: 1.9.3 (2011-09-23 patchlevel -1) [x86_64-darwin11.3.0]
    - INSTALLATION DIRECTORY: /Users/andreas/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1
    - RUBY EXECUTABLE: /Users/andreas/.rbenv/versions/1.9.3-rc1/bin/ruby
    - EXECUTABLE DIRECTORY: /Users/andreas/.rbenv/versions/1.9.3-rc1/bin
    - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
    - GEM PATHS:
    - /Users/andreas/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1
    - /Users/andreas/.gem/ruby/1.9.1
    - GEM CONFIGURATION:
    - :update_sources => true
    - :verbose => true
    - :benchmark => false
    - :backtrace => false
    - :bulk_threshold => 1000
    - "gem" => "--no-ri --no-rdoc"
    - REMOTE SOURCES:
    - http://rubygems.org/

  • Iulian Onofrei
    Iulian Onofrei about 3 years
    Deleting the lock file means implicitly updating all the gems to the latest versions, which you might not want to.