0

I add this to Gemfile:

gem 'omniauth-facebook'

Then I run bundle update. No problem so far. But when I run rails server I get this error:

Could not find hashie-1.2.0 in any of the sources
Run `bundle install` to install missing gems.

I thought that bundler was supposed to resolve and satisfy all dependencies, but I tried this anyway:

gem install hashie-1.2.0

Which gave this:

ERROR:  Could not find a valid gem 'hashie-1.2.0' (>= 0) in any repository
ERROR:  Possible alternatives: hashie-model

I'm new to Rails and I feel I'm at a dead end. Suggestions?

UPDATE: I also have run bundle install (to be exact bundle install --without production) several times. I get the same error when running rails server after that.

UPDATE: I aslo tried adding gem 'hashee' in the Gemfile before omniauth-facebook. No luck.

Tim Scott
  • 15,106
  • 9
  • 65
  • 79
  • UPDATE: When I push up to Heroku it's fine. I guessing something is corrupt in my environment. Suggestions how to figure out what? Here is some basic env info: [Rails 3.2.2 | ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0] | gem 1.8.10 | Bundler version 1.0.22] – Tim Scott Mar 06 '12 at 21:05

2 Answers2

0

So I think you are just using bunder incorrectly.

bundle update doesn't resolve new dependencies, it simply looks at the gem manifest, which is stored in Gemfile.lock and updates those gems to the most recent gem allow by the constraints placed on them in the Gemfile.

Since you are trying to install a new gem, what you what to run is bundle install which will make a comparison between your Gemfile and your Gemfile.lock and install any gems that are not listed in your Gemfile.lock.

I think bundle install should do the trick for you.

As a side note, bundler tries to make this as easy as possible for you by aliasing bundle to bundle install. So, unless you are explicitly looking to update your gems, you can just type bundle and get the behavior that you are expecting.

TheDelChop
  • 7,938
  • 4
  • 48
  • 70
  • Sorry I did not provide enough information. I ran bundle install as well as then bundle update. I did this multiple times. Same error. – Tim Scott Mar 05 '12 at 22:28
  • ah ok, interesting. Well, in that case, add hashie to your Gemfile before omniauth-facebook. `gem 'hashie', '~>1.2.0'` – TheDelChop Mar 05 '12 at 23:33
  • Yeah, I tried that already too, except I used the version number and did it at the end of the file. In any case, I tried it just like you said, and I still get the error. – Tim Scott Mar 05 '12 at 23:54
0

I got it working. I think it was some problem with bundler. I did some different things, and I have to admit that I'm not 100% sure what fixed it. I think what did it was this:

gem uninstall bundler
gem install bundler
bundle install mail

However, it did not work until my second reinstall I think. Upon the install command, it installed everything, not just mail and its dependencies. The only other thing I did was to delete /usr/bin/bundler after the first reinstall. It did not reappear.

Tim Scott
  • 15,106
  • 9
  • 65
  • 79