我有一个Gemfile,我添加了一个新的宝石
gem 'activerecord-oracle_enhanced-adapter', git: "https://github.com/rsim/oracle-enhanced.git", branch: "rails4"
当我运行bundle install
时,我得到了
> 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)
...
但是当我打电话给gem list
时,宝石就会丢失。如果我尝试在irb中加载这个gem,我会得到
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)
我不明白这种行为。我有几个宝石以这种方式添加到我的Gemfile中,并且所有宝石都在工作。
我的测试系统:
如果我调用gem install activerecord-oracle_enhanced-adapter
,则安装此gem,但不是来自'rails4'分支,我想使用Gemfile
答案 0 :(得分:1)
尝试调用bundle exec irb
,这样您就可以在特定的Gemset范围而不是系统范围内加载irb。