简体   繁体   English

捆绑包安装后,宝石不可用

[英]Gem is not available after bundle install

I have a Gemfile where I add a new gem 我有一个Gemfile,在其中添加了新的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我得到

> 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. 但是当我调用gem list ,gem丢失了。 If I try to load this gem in the irb, I get 如果我尝试在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)

I do not understand this behavior. 我不了解这种行为。 I have several gems added to my Gemfile this way and all of them are working. 我以这种方式将几个宝石添加到我的Gemfile中,并且所有宝石都在工作。

My system for the test: 我的系统进行测试:

  • RVM RVM
  • ruby 2.0.0p195 红宝石2.0.0p195
  • new gemset 新宝石
  • new rails 4 project without any modification except this gem in the Gemfile 除了Gemfile中的这个gem外,没有任何修改的新Rails 4项目
  • I tried it with two different users 我尝试了两个不同的用户
  • Ubuntu 12.04 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 如果我调用gem install activerecord-oracle_enhanced-adapter ,则会安装该gem,但不是从'rails4'分支安装的,我想使用Gemfile

尝试调用bundle exec irb这样您将在特定的Gemset范围而不是系统之一中加载irb。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM