18bytes
18bytes

Reputation: 6029

Portable rails app with dependencies

Is there anything to make the rails development portable across operating systems (with prerequisite of ruby and rails installed in all OS)?

For example:

  1. I want to create an rails application named "iApp" in windows (Rails 3.2 installed already)
  2. Add necessary gems to "Gemfile" and run "bundle install"

    Expectation: All dependencies must be installed within "iApp" folder

  3. Copy the iApp folder to a linux machine (Rails 3.2 installed already)

  4. run "rake tests" or run "rails s"

    Expectation: It should work outof the box without running "bundle install"

Should be possible to repeat steps 3 & 4 in a Machintosh as well.

Will RVM solve this problem? or is there any solution for this?

Upvotes: 2

Views: 318

Answers (2)

aciniglio
aciniglio

Reputation: 1837

You can use bundle package to get most of the benefits of this. You'll still need to run bundle, but it won't call out to any remote repositories.

See: http://gembundler.com/bundle_package.html

Note that your idea for having completely portable gems will be broken by having native gems or gems that link against native packages (this will require a recompile on each new machine). Again, 'bundle package' takes care of this for you.

Upvotes: 1

Nick Messick
Nick Messick

Reputation: 3212

You are going to need to be more specific of what your "dependancies" are.

Also, many gems are OS specific, so just copying the gems between machines probably won't work for you.

Any reason why you don't want to do a bundle install on the Linux machine?

Upvotes: 1

Related Questions