Rails 3 on Dreamhost via Capistrano

Dreamhost has started rolling out Rails 3.0.3 to its servers; however, there’s a couple of snags that may prevent you from quickly and easily deploying a Rails app. I’ve spent the better part of a couple of hours overcoming these challenges, some of which might have been due to me climbing the Rails 3 deployment learning curve. I was running into all kinds of problems with “500 Internal Server Error”, as well as being unable to get the required gems installed properly, including the required native extensions.

Allow me to save you some time.

First problem: the bundle executable isn’t in your PATH environment by default, either for login shells or non-login shells. The fix is simple – just add the right path to your .bashrc and .bash_profile: export PATH="/usr/lib/ruby/gems/1.8/bin:$PATH"

Second problem: you need to make sure to use bundle install properly to resolve and install your dependency gems. Simplest solution is to add require 'bundler/capistrano' to the top of your deploy.rb.

Those two small additions will resolve problems deploying Rails 3 apps via Capistrano on Dreamhost. Happy coding!

“Security error accessing url” in Flash 9,0,124,0

Adobe FlashIt appears the April update of Flash Player’s security policies have some implications for Amazon’s web services. Per the release information, it appears that is is no longer sufficient to have a crossdomain.xml file that contains <allow-access-from domain="*"/>:

In order for a SWF to send a header anywhere other than its own host, the origin domain of the SWF must have explicit permission from the host to which the header is being sent, in the form of a policy file. The existing policy file model will apply, with the same file locations and ActionScript APIs, but a new syntax will be required. To specify header-sending rights, use this new tag: <allow-http-request-headers-from>.

Without such an entry, whenever you use the WebService tag in MXML to access an Amazon web service, you’ll get the “security error accessing url” message. I currently have this problem with the following use of WebService tag:



...

This code functioned without issue until I updated to Flash Player 9,0,124,0. I’ve started a thread on the Amazon Web Services Developer Connection, so hopefully someone at Amazon add the appropriate <allow-http-request-headers-from domain="*"/> entry into the crossdomain.xml file at webservices.amazon.com to address this problem.

Hopefully this post saves some people a few hours of beating their heads against a wall. Unless I’m totally mistaken, and there’s a workaround that doesn’t involve using a proxy?