开发者

How to use multiple bundle paths in Ruby on Rails (bundler)

I'm using a few gems for interactivity with my database and to provide easy pagination. After deploying my application on my server, it'll automatically execute bundle install to install those gems if they aren't ins开发者_高级运维talled yet. This is helpful when I deploy a codebase update including a new gem.

However, there's one gem (will_paginate) I've made a little change to (so that it always shows on what page you are, no matter the total number of pages).

Therefore, I used bundle install --local --path vendor at my local machine (OS X Lion) so that I can easily edit them (at per-app base, instead of system-wide).

Because of dependency problems, I cannot 'just' copy the vendor-folder to my web server. Therefore, I decided to add another rule to my .gitignore-file:

vendor

Because this caused my customized will_paginate-gem not to get uploaded, I executed another command:

git add -f vendor/ruby/1.8/gems/will_paginate

Now, when I push, the only gem in the vendor folder at my web server is will_paginate, which is great.

However, it doesn't get loaded, since it isn't in the bundle path.


I already tried to create a file called .bundle/config and add the following in it:

---
BUNDLE_PATH: vendor

I also tried adding BUNDLE_DISABLE_SHARED_GEMS: "0", but using this, bundle check says it's missing the shared gems.


My question is, how can I add a bundle path vendor, and fallback on the system-wide gem-path.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜