0

I have a Gemfile where I add a new gem

gem 'activerecord-oracle_enhanced-adapter', git: "https://github.com/rsim/oracle-enhanced.git", branch: "rails4"

When I run bundle install I get

> bundle install
Updating https://github.com/rsim/oracle-enhanced.git
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
...
Using activerecord (4.0.0)
Using activerecord-oracle_enhanced-adapter (1.4.2) from https://github.com/rsim/oracle-enhanced.git (at rails4) 
Using bundler (1.3.5)
...

But when I call gem list, the gem is missing. If I try to load this gem in the irb, I get

irb
require 'rubygems'
=> false
gem 'activerecord'
=> true
gem 'activerecord-oracle_enhanced-adapter'
Gem::LoadError: Could not find 'activerecord-oracle_enhanced-adapter' (>= 0) among 49 total gem(s)

I do not understand this behavior. I have several gems added to my Gemfile this way and all of them are working.

My system for the test:

  • RVM
  • ruby 2.0.0p195
  • new gemset
  • new rails 4 project without any modification except this gem in the Gemfile
  • I tried it with two different users
  • Ubuntu 12.04

If I call gem install activerecord-oracle_enhanced-adapter, this gem is installed, but not from the 'rails4' branch and I would like to use the Gemfile

Bjoernsen
  • 2,016
  • 1
  • 33
  • 41

1 Answers1

1

Try calling bundle exec irb so you will load irb in specific Gemset scope instead of system one.

zrl3dx
  • 7,699
  • 3
  • 25
  • 35
  • Thank you. I still do not know, why this gem is not listed (all others are) using `gem list`, but `bundle exec gem list` shows the gem. `bundle exec irb` works as well. – Bjoernsen Aug 22 '13 at 12:33
  • 1
    Maybe that link will help you, generally speaking, `bundle exec` runs command in current Gemset scope: http://stackoverflow.com/questions/6588674/what-does-bundle-exec-rake-mean – zrl3dx Aug 22 '13 at 12:34