开发者

Bundler: forcing it to load from two different directories

Because of IT requirements at my company any gems that require compilation have to be installed by IT engineers, and any pure ruby gems are installed into a subfolder of the project. To satisfy these needs, we seperated out our gems into various groups:

source 'http://rubygems.org'
gem 'rails', '3.0.0'
gem 'activerecord-oracle_enhanced-adapter', '~> 1.3.1'
gem 'memcache-client', :require => 'memcache'
gem 'builder'
gem 'acts_as_list'

group :development, :test do
  gem 'sqlite3-ruby', :require => 'sqlite3'
  gem '开发者_开发技巧ruby-debug19', :require => 'ruby-debug'
end

group :native do
  gem 'ruby-oci8'
  gem 'nokogiri'
end

When we install we run the build command on our test server we run bundle install --without native

This properly installs the ruby only version gems. Afterwards, the build server modifies the .bundle/config file from this

--- 
BUNDLE_PATH: vendor/bundle
BUNDLE_WITHOUT: development:native
BUNDLE_DISABLE_SHARED_GEMS: "1"

to this

--- 
BUNDLE_PATH: vendor/bundle
BUNDLE_WITHOUT: development

However it still fails to load the gems properly:

timetips1-lm27:~/ka$ ./script/rails c tii_test

Could not find ruby-oci8-2.0.4 in any of the sources

Try running bundle install.

I have been scouring through source code trying to find a way to force Bundler to use the normal load paths but have really come up and short, and my brain is fried from staring at source code for two days. Any ideas on how to resolve the issue?


So it turns out I am doing everything correctly. IT didn't install the ruby-oci8 gem but rather manually compiled the ruby-oci8 library and loaded it onto each server.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜