freeze gems

rake rails:freeze:gems表示把当前Gems安装的Rails Unpack到vendor/rails
rake rails:unfreeze则表示删除vendor/rails

 

If you have any Rails apps on shared hosts, you know that you have to copy your own libraries into the ./lib folder of your app.

I thought that the new “rake freeze_gems” would do that, but it only freezes the Rails-relevant gems (ActiveRecord, ActionMailer, etc.). If you use any other libraries (like Gruff), you’re on your own.

I wanted to have an automated solution for doing this in a way that worked with Subversion and Switchtower. So I whipped up a little Christmas gift for myself (and I’m re-gifting it to you).

Download Freeze Other Gems Rake Task

Usage

Copy gems.rake into ./lib/tasks. This will make it available to rake.

Edit gems.rake to list the names of the other gems you want to synchronize. In the example, I’m using gruff, sparklines, and pdf-writer.

Then, do

rake freeze_other_gems

The files will be copied from your local installed gems and will keep any .svn files intact. You can just “svn update” and your updated gems will be ready to deploy with Switchtower!

And also…

New podcast with the brilliant Avi Bryant.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值