Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby On Rails 3.x Offline Install (without internet connection)

I really appreciate if one can provide some insight for installing ruby on rails 3.x framework to a computer without internet connection.

All the tutorials or explanations seem to assume that there is always an internet connection. Is there simple way to download a bundle with all the dependencies included and simply install the bundle.

Thanks in advance

like image 435
benibilme Avatar asked Jan 18 '12 08:01

benibilme


2 Answers

Finally. The complete list of Gems that you need to download manually, in order to install Rails in Offline mode (or behind a proxy that prevents your "gem" commands from working).

This list assumes that you already have the following things (Windows 7):

  1. Ruby 1.9.2

  2. RubyGems 1.8.24

  3. DevKit

  4. THE LIST.

Go to rubygems.org and use the Search function to download each one of the following Gems. You don't need to type the complete name with version numbers and stuff. For example, just "actionmailer" will work and will find the latest version).

Each gem page shows you the command line you have to type when installing it normally in a computer that isn't behind a proxy. Ignore it and just click the download link.

  • actionmailer-3.2.6.gem
  • actionpack-3.2.6.gem
  • activerecord-3.2.6.gem
  • activeresource-3.2.6.gem
  • activesupport-3.2.6.gem
  • rake-0.9.2.2.gem
  • i18n-0.6.0.gem
  • multi_json-1.3.6.gem
  • activemodel-3.2.6.gem
  • arel-3.0.2.gem
  • tzinfo-0.3.33.gem
  • builder-3.0.0.gem
  • erubis-2.7.0.gem
  • journey-1.0.4.gem
  • rack-1.4.1.gem
  • rack-cache-1.2.gem
  • rack-test-0.6.1.gem
  • sprockets-2.1.3.gem
  • hike-1.2.1.gem
  • tilt-1.3.3.gem
  • mail-2.4.4.gem
  • mime-types-1.19.gem
  • treetop-1.4.10.gem
  • polyglot-0.3.3.gem
  • rails-3.2.6.gem
  • bundler-1.1.4.gem
  • railties-3.2.6.gem
  • rack-ssl-1.3.2.gem
  • rdoc-3.12.gem
  • thor-0.15.3.gem
  • JSON-1.7.3.gem

(31 files total)

Just keep in mind that the versions may change. I did this in June 2012 and those were the versions that worked for me.

Copy all those files to the Ruby installation dir. Then, open a CMD console.

cd \ 
cd  <RubyInstallDir>
gem install rails-3.2.6.gem

Installation should run normally. It is possible that some dependencies need a different version. In that case, the error message will show you the right version. So you just need to download the version from rubygems.org (there is a list of old versions in the gem's page) and run the gem install command again.

I hope this can help.

like image 147
gstvstt Avatar answered Sep 20 '22 10:09

gstvstt


You can use bundler to achive that. Bundler accepts the path where you can specify the location for the gems to be installed. Run the following command where you have internet connection. It will download all the dependencies and pack them into the specified folder.

bundle install --path gems # 'gems' is the folder present in Rails.root

Now that all the dependencies are within the project, you can copy the project to the machine where you don't have internet connection. From now on use the commands like:

bundle exec rails server
bundle exec rails console

Note that you have to install the bundler gem manually in the target machine.

like image 26
Arun Kumar Arjunan Avatar answered Sep 20 '22 10:09

Arun Kumar Arjunan