Rails

HostingRails and Capistrano Permissions Mismatch • April 9, 2010

I stumbled across a problem, and then a solution, today, when deploying a Rails application to HostingRails. After I deployed, I started getting Application (500) Errors on all of my pages.

After talking with support, I found out that is was because the group write permission was being turned on on my dispatch.fcgi file. Looking further though, I realized that all of my deployed files had group write turned on! So, the question was, why?

Some searching led me to this post on the HostingRails forum, which essentially says that starting with version 1.4, Capistrano turns on group write for all your files by default. Lovely.

One commenter posed this solution (which I slightly modified), which worked for me:

In deploy.rb, add the following code:

desc "Set permissions to 755, so HostingRails does not complain"
task :hostingrails_fix do
  run "chmod 755 #{deploy_to}/current/public"
  run "chmod 755 #{deploy_to}/current/public/dispatch.*"
end

after "deploy:symlink", :hostingrails_fix

Easy Ranking with Rails and MySQL • July 14, 2009

As part of some of the new features I'm adding to Sphericle, I needed to add a ranking system for user accounts, based on a point system. Specifically, I needed to write a method for my User class (on the Sphericle server, which is a Rails app) that would give me the ranking for a User, based on how many points that User has compared to all the other Users. read more »

Syndicate content