Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I added the gem in rails, but it still says gem missing?

I typed the following:

gem install omniauth

In my environment.rb file, I also have:

config.gem "omniauth"

However, I get these errors:

no such file to load -- omniauth/core
Missing these required gems:
  omniauth

I'm confused: I do a rake gems:install and don't get an error (I don't get a message back, either). But then I try to run script/server and it says I need to do rake gems:install!

When I remove the config.gem "omniauth" from environment.rb, I get this:

c:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant': unin
itialized constant OmniAuth (NameError)
like image 316
Satchel Avatar asked Dec 03 '10 01:12

Satchel


1 Answers

Now that Rails 3 is using bundler, you need to make it explicit that you want access to a specific gem in your app. To do this, go into your Gemfile (in the root directory of your project) add this line:

gem 'omniauth'

then run bundle install in the project directory, and you should be good to go. bundle install simply makes sure that all gems and dependencies are installed on the current system. Good luck!

like image 189
Sam Ritchie Avatar answered Sep 21 '22 23:09

Sam Ritchie