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.

你可能感兴趣的:(Rails,SVN,subversion,ActiveRecord,UP)