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)

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!


Need Your Help

Generation of svg on server side using highcharts

node.js svg highcharts jsdom

I did require('jsdom') in node js but i constantly get jsdom module not found.

Using a custom class as a JAX-WS return type?

java jax-ws marshalling

I'm using NetBeans's Web Service generation tools. I've looked at the tutorials available, but cannot find anything on how to use a custom class as a return type. Most of the tutorials I've read ar...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.