RVM – no such file to load — openssl

Installed ruby 1.9.2 via RVM and getting the following error? no such file to load -- openssl Try getting RVM to install the required openssl files. Unfortunately this means removing ruby and installing it again. rvm pkg install openssl rvm remove 1.9.2 rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr But...

Running Resque Workers from Upstart + RVM

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 app cd /home/myapp/ #...

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...

SQL – Changing to British Datetime format

Error converting data type varchar to datetime Are you getting the above error? Run the following under your app user. select @@Language, @@Langid If it says us_english then you’re probably hitting errors when parsing dates as DD/MM/YYYY. We can change the default language for a particular user....

Ruby On Rails AJAX File Upload With Valum

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(){ var...

WordPress on Mobile (iPhone and Android)

WPTouch is a fantastic plugin for WordPress that allows your users to browse your WordPress Blog on iPhone and Android mobile phones. http://www.bravenewcode.com/products/wptouch/ If you want to customise the mobile theme, you can modify the PHP theme included in your wp-content/plugins/wptouch/themes...

rake db:seed | Don’t know how to build task error

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 Did you like this? Share it:Tweet

Ordinal Number in Reporting Services

Recently I had a client request for reporting services dates to use ordinal numbers, that being, “1st instead of 1, 2nd instead of 2″ etc. To my surprise, this isn’t a standard datetime format in reporting services! So I set out to create my own ordinal function based on a C# version...

Will_paginate with multiple models

If you need to implement paging in your Ruby on Rails application, a quick and easy way is to use the fantastic “Will_Paginate” plugin (available here). However I came across a need to paginate multiple models on the same page, for example; a list of users and a list of groups. Luckily Google...

Capistrano issues – no such file or directory

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...

How to fetch Last Record in Subsonic

Is it just me or is Subsonic the topic of discussion right now? I had a need to retrieve the last ID that had been generated in a table; that being, the last “auto increment” ID of a table. The following example worked a charm using Subsonic and activerecord. var fetch_ref_id = contract.All().OrderByDescending(c...

Subsonic ordering – OrderByDescending

So the subsonic documentation sucks. If you’re new to activerecord, linq and subsonic in general; you’ll find it fairly hard to construct basic queries. However once you’ve got it under control, it’s a piece of cake. To sort your table using activerecord, use the following examples; To...

« Previous Entries