why the size of rails souorce and gem is different ?

Hi ,

I just curious to know, why the source of rails (about +10mb) vs rails.gem (+200kb) is very different ?

I just want to know how to use the rails from source instead from the gem ...

Thank you ! :smiley:

I just curious to know, why the source of rails (about +10mb) vs rails.gem (+200kb) is very different ?

I just want to know how to use the rails from source instead from the gem ...

The gem is a small stub that requires other gems such as active_record, action_pack, action_mailer, etc... Look at the dependancies for the rails gem to see them all.

-philip

Ok, so the source come up with the dependecy right ... how to install it from source? I might be prefer the source than the gem because I cannot download the package using gem (blocked by proxy and i need to install on several offline sources)

Tx

Philip Hallstrom wrote:

what if the computer are offline ... :slight_smile: i used to open the gem and check for the dependency and then downloading the other gem (from internet cafe, i have no internet access at my boarding house) For each gems i did checking and downloading manually from gems.sourceforge.net And i did installation using gems at home, one by one .... so if the source has everything in one ... i would be helpfull for me :smiley:

while in the office, i can access the internet but the gems must go thru the proxy (i read the wiki about gems installation, and they mention to download apsever from sourceforge.net, but i couldnt download it since the website was gone .. )

so, that was the condition :slight_smile:

"rake rails:freeze:gems

This will copy the Rails files to the "vendor/rails" directory of your application. When the Rails framework runs, your application will first check for the presence of this directory. If it exists, Rails will load the Rails components from the directory instead of using the main server copy of Rails. As long as you do not delete these files, your application will continue to use your "frozen" version of Rails."

Copy the folder from one app to all the other ones that are offline.

Of course, all your applications should be compatible with the version you are freezing.

i dont think this will solve the problem. because it just freeze the rails version not installing new one using source :slight_smile:

i dont think this will solve the problem. because it just freeze the rails version not installing new one using source :slight_smile:

Yes, it will.

At the internet cafe, create a bare bones rails application (ie. rails barebones). Then run the rake rails:freeze:gems task below. That will copy all of the "source" into vendor/rails.

Now, zip that up and keep it somewhere you can access it. Copy that to all your other machines and rename "barebones" to the name of your application (as well as tweaking config/database.yml, etc.).

Now each rails app will have it's *own* copy of the "source".

-philip

I would do slightly different.

Instead of zipping everything, I would zip only the vendor folder, because thats what he needs.

Then on a “offline” machine, just copy the vendor folder over, check environment.rb about RAILS_VERSION. If environment.rb requires a version that is different than the one in the vendor folder I dont think its going to work.

You can freeze gems or you can freeze edge and specify a tag

rake rails:freeze:edge TAG=‘rel_1-2-6’

This is really the appropriate thing to do on a server because it’s safer. Your apps are unaffected should you update a gem.

However, I’ve found that the simplest solution is to do this:

On your machine with Internet access:

mkdir /rails svn co http://dev.rubyonrails.org/svn/rails/tags/rel_2-0-1/ /rails/201 svn co http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-6/ /rails/126 svn co http://dev.rubyonrails.org/svn/rails/tags/rel_1-1-6/ /rails/116

Copy the /rails folder out to your server.

Whenever you deploy a new app, either

  1. copy the version of Rails to your app’s vendor/rails folder

or better,

  1. synmlink /rails/210 to your_app/vendor/rails

Do this in your after_update step in Capistrano and you’re all set :slight_smile: