---
title: "Package up all your .gem files in vendor/cache "
author: "夜鸣猪"
date: "2013-02-14T23:51:32Z"
tags: []
categories: ["编程语言"]
slug: "package-up-all-your-gem-files-in-vendor-cache"
draft: false
lastmod: "2013-02-14T23:51:32Z"
id: 1798127
url: "https://hlee.iteye.com/blog/1798127"
---

```java
gem 'my_private_gem', :path => "vendor/gems/my_private_gem-VERSION"
```



```java

gem list | awk '{print $1}' | xargs gem unpack --target vendor/gems

```



bundle install --deployment. This will install the gems, in their unpacked state, in vendor/bundle.


Package up all your .gem files in vendor/cache


```java
$ bundle package
```


Running bundle install in an application with packaged gems will use the gems in the package and skip connecting to rubygems.org


```java
$ bundle install --local
```


You can use this to avoid a dependency on rubygems.org at deploy time, or if you have private gems that are not in a public repository