Cloning Ruby on rails application on a second box - no internet connection

Go To StackoverFlow.com

1

I have a RoR application running on box1...it obviously has Ruby, RubyGems, and Rails installed on that box, along with a few other gems.

I want to copy this whole set-up so it runs independentally on box2 as well.

Neither box has an internet connection, but an internet connection is available on another machine.

So as far as I can see, I need to-

  • Install Ruby on box2 (I have an RPM, no problem)
  • Install RubyGems on box2 (I have an RPM, no problem)
  • Install Rails (How do i do this?)
  • Copy over entire Rails app directory onto box2?

The only guidance on the Ruby on Rails site is to run gem install rails but I cannot do this without an internet connection.

So can I just run bundle package on box1, then copy over the resulting gem files onto box2 and do a local gem install on each one to install them? Or can I simply copy 'usr/local/lib/ruby/gems/1.9.1/gems' directory onto box2?

Secondly, I plan on packing my Rails app into an RPM so I can easily deploy it wherever I want...can I just include my gem files (resulting from bundle package) in the RPM directory structure, and then direct the RPM in the .spec file to do a gem install during installation? That way it'll install the required gems as the RPM is being installed.

It's possible I'm overlooking a much simpler method, or misunderstanding something, if so, please enlighten me. Any help?

2012-04-04 17:02
by Exbi


1

Take a look at Vagrant and the Railscasts episode.

Vagrant will solve your "deploy anywhere" problem by putting everything in a virtual machine that has all your gems installed.

Of course, this won't solve your immediate problem due to lack of internet access but it does sound like you're on the right track.

2012-04-04 17:10
by rocketscientist
I'm yet to test vagrant, but from reading about it, it's probably along the lines of what I'm looking for - Exbi 2012-05-19 15:14
Ads