Nginx custom headers for a Unicorn Rails...
Recently I had to implement an API for a Rails app running on Unicorn being proxied in from Nginx. The problem I had was that my custom header wasn’t being passed through from Nginx. I had already gone ahead and added to my location directive proxy_set_header X_SESSION_KEY $http_x_session_key; But...
Running Resque Workers from Upstart + RV...
I recently had the task of getting resque workings to start from Ubuntu’s upstart daemon. First I created a bash script with the following; #!/bin/bash # Load RVM into the shell source "$HOME/.rvm/scripts/rvm" # Switch to the right RVM version rvm 1.9.2 # CD to the rails...
Valum Fileupload +jQuery +csrf...
I recently went to implement Valum’s Fileupload script with a Ruby on Rails jQuery project I was working on. One thing I figured out is that all requests in Rails3 must send also send the X-CSRF-Token. Now normally the rails.js jQuery adapter takes care of this; but Valum’s fileupload script...
Ruby On Rails AJAX File Upload With Valu...
Some sample code I wrote with Andrew Valums’s AJAX uploader script and Ruby On Rails. Note; I use the prototype javascript library to manipulate the DOM during the onComplete event. If you need any help getting this to work, simply use the comments below. function createUploader(){ ...
rake db:seed | Don’t know how to b...
So I ran into a little issue today, I wasn’t able to get my rake db:seed task to work. This is the error I was getting; rake db:seed don't know how to build task The solution? Update rails to 2.3.5 How? gem update rails
Capistrano issues – no such file o...
So I was playing around with my new Slicehost the other day and following their guides to automate a Ruby on Rails deployment process using capistrano. For those that don’t know, capistrano comes as a ruby gem which allows you to completely automate tasks. In my case, I wanted to remotely tell...
Installing Postgres gem on Windows...
So you’re trying to install the postgres gem for ruby on rails, but you’re getting the following message; Could not find PostgreSQL build environment (libraries & headers): Makefile not created This is most likely due to the fact that you’re not using the mswin32 gem for Ruby. Give...