【发布时间】:2013-08-22 11:24:38
【问题描述】:
我有一个 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 中加载这个 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)
我不明白这种行为。我以这种方式将几个 gem 添加到我的 Gemfile 中,并且它们都在工作。
我的测试系统:
- RVM
- 红宝石 2.0.0p195
- 新宝石组
- 新的 rails 4 项目除了 Gemfile 中的这个 gem 没有任何修改
- 我尝试了两个不同的用户
- Ubuntu 12.04
如果我调用 gem install activerecord-oracle_enhanced-adapter,这个 gem 已安装,但不是来自“rails4”分支,我想使用 Gemfile
【问题讨论】:
标签: ruby-on-rails gem bundle ruby-on-rails-4 gemfile