views:

434

answers:

5

I have a Rails app that I need to deploy. Here are the facts:

  • The app was developed on Windows and requires Windows binary gems
  • The app is to be deployed onto an Open Solaris shared server (Joyent)
  • I do not have permissions to install gems on the server
  • For the non-binary gems, I can simply do a rake gems:unpack locally and then upload; this works just fine.

So my question is, how do I get the binary gems I need onto my production server?

A: 

The binary gems are the real problem. For all other gems you can use the vendor/gems directory (only possible with Rails 2.1+).

Christoph Schiessl
A: 

Vendor everything.

This does two things. It makes your application deployable without depending on system installed gems and secondly it freezes a specific version of a gem to your application. So if someone else checks that out of your SCM tool, they won't have a version mismatch and will be up and running with no issues.

Good luck!

mwilliams
Is it possible to "vendor" binary gems (gems based on C code)?
Christoph Schiessl
Vendor Everything is the ancestor of rake gems:unpackhttp://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies
Charles Roper
A: 

You will probably have to use a cross-compiler to target Solaris that runs on Windows.

Building cross-compilers is generally a difficult and error prone process. I have done it before and the complexity is not for the faint of heart. Ideally, you will find someone with access to a Solaris build-machine and have them create the binary for you.

If you have to go with the cross-compiler route, I suspect the solution will be to install cygwin and use its build-tools to create a cygwin-hosted solaris cross-compiler. I would suggest looking at the crosstool project which will provide you with scripts that handle some of the details for you.

sock
Would it not be easier to simply install Open Solaris on a VirtualBox VM and compile it there?
Charles Roper
Yes, I suppose it would. The poster did not mention Open Solaris, though, so I assumed it was something older.
sock
+1  A: 

Request that the shared server admin install the gems for you. If they are "standard" gems available from a reputable domain, it really shouldn't be that big a deal, my shared server provider does it all the time.

Yardboy
+2  A: 
  • The app was developed on Windows and requires Windows binary gems
  • The app is to be deployed onto an Open Solaris shared server (Joyent)

You do realise that you can't run windows binaries on open solaris. Windows is in fact entirely different from solaris...

If the gems are from a third party, you may be able to download pre-packaged binary versions for solaris which someone else has produced. You can then put them in the vendor directory and load them from there rather than installing a gem.

If you can't get pre-packaged binaries for solaris, you'll need to get your own solaris machine (using Virtual PC, VMWare, VirtualBox, etc), use it to compile the gems, then pull the binary files out.

If you in fact only have source code which works on windows (eg: you built it yourself, or the person providing the gem only designed it to work on windows), you are screwed. You will need to find a cross-platform replacement.

It would help if you could tell us which gems you are talking about, so people could help track down a more specific solution, and explain exactly what's going on.

Orion Edwards
Joyent appear to give you root access, so you can install any gem you want, assuming it can be compiled under Solaris http://wiki.joyent.com/all-accelerators:kb:rubygems
Dave Cheney
good point, I forgot about that. Joyent (and the solaris zones thing that lets them do it) are awesome
Orion Edwards