0

我有一个 Gemfile,我在其中添加了一个新的 gem

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 中,我会得到

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 中,并且它们都在工作。

我的测试系统:

  • 虚拟机
  • 红宝石 2.0.0p195
  • 新宝石
  • 新的 rails 4 项目,除了 Gemfile 中的这个 gem 没有任何修改
  • 我尝试了两个不同的用户
  • Ubuntu 12.04

如果我打电话gem install activerecord-oracle_enhanced-adapter,这个 gem 已安装,但不是来自“rails4”分支,我想使用 Gemfile

4

1 回答 1

1

尝试调用bundle exec irb,以便您将 irb 加载到特定的 Gemset 范围而不是系统一。

于 2013-08-22T12:01:59.617 回答