0

For the record, I already fixed my problem, but I'm trying to figure out what happened so it doesn't happen again.

I had been using Ruby earlier today and hadn't had problems. All of a sudden, I cant run anything.

In the past, I'd forget tobundle install and doing that that would make work out, but this time, I didn't even get that message. Instead I got this:

[ERROR] cannot load such file -- bundler/setup

And on trying to bundle install, I'd have this error:

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'bundler' (>= 0) among 16 total gem(s) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /usr/bin/bundle:22:in `<main>'

So bundler is not there? Where did it go?

I ended up having to do gem install bundler per this post. Then did bundle update and now everything works fine.

What may have happened?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Alexander Kleinhans
  • 5,950
  • 10
  • 55
  • 111

1 Answers1

1

Do you use RVM (or something similar)? It sounds like you were using a bundler from system or somewhere else in your path. I have seen that error when this happens.

Installing bundler for the current ruby should fix the problem -- which is what you did.

Amir Raminfar
  • 33,777
  • 7
  • 93
  • 123
  • No, I didn't use RVM. I'm not that familiar with Ruby. How should I have used it? – Alexander Kleinhans May 28 '15 at 00:10
  • Maybe you are already using it and you didn't know. It's too much detail to go in to this question. But my guess would be that you changed something in your configuration and suddenly started using a different ruby. – Amir Raminfar May 28 '15 at 00:10
  • can you tell me where I'd change the configuration? – Alexander Kleinhans May 28 '15 at 00:20
  • By configuration, I mean things like your terminal or environment. I don't really have an easy way to know what happen. Next time you see this error, do `which ruby` and `which bundle` to see which one is being used. – Amir Raminfar May 28 '15 at 00:25