Felipe Lima
Felipe Lima

Reputation: 10730

Bundler gem installed from github get installed in a different location

I am trying to install a gem from github like this:

gem 'omniauth', :git => "git://github.com/intridea/omniauth.git", :require => "omniauth"

The problem is that the gem is not actually being loaded. The ruby objects are not there.

So, bundle show omniauth shows me: Users/felipe/.rvm/gems/ruby-1.9.2-p136/bundler/gems/omniauth-5972c94792cf

The problem is that the gem is being installed to a different location from the regular ones. I expected it to be `/Users/felipe/.rvm/gems/ruby-1.9.2-p136/gems/``

Any idea on how to fix this?

Upvotes: 1

Views: 340

Answers (2)

Adriano Bonat
Adriano Bonat

Reputation: 90

I think you're missing these two lines:

require "rubygems"
require "bundler/setup"

as you can see in Bundler's source code, "bundler/setup" is going to put gems managed by Bundler in the Ruby's load path: https://github.com/carlhuda/bundler/blob/1-0-stable/lib/bundler/setup.rb#L22

Hope this helps :)

Upvotes: 1

marano
marano

Reputation: 742

try changing the bundler line to.

gem 'omniauth', :git => "git://github.com/intridea/omniauth.git", :require => 'oa-oauth'

The problem is that your :require property was pointing to the wrong file to load. It is not always the same name as the library, by the way, when both lib name and require are the same you don't need to specify it, only when they differs.

Upvotes: 1

Related Questions