Friday, 29 April 2011

Steps to vendor rails Or upgrade vendor rails in an application

Step 1 # Install Rails required version ( say 2.3.10 ) ( for ubuntu gem install rails -v = 2.3.10 )

Step 2 # To ‘freeze’ your rails gems, simply type the following in your terminal window: rake rails:freeze:gems 
This will create a new folder in /vendor/ called ‘rails’ and unpack all of the core Rails gems.

Step 3 # Instead of having to install the required gems wherever your app goes, your app can pack the gems up and take them with it .

To unpack the required gems simply run rake gems:unpack:dependencies 
This will unpack all of the gems required in your environment.rb file plus any gems they may require into vendor/gems/
 

Step 4 # Now you can uninstall rails ( for ubuntu gem uninstall rails ) . And Your app will have use rails with version 2.3.10


If you decide to unfreeze Rails and revert back to the system installed version instead, simply run

rake rails:unfreeze
This will remove the rails directory from /vendor/ and all of its contents.

No comments:

Post a Comment