Posts Tagged ‘Ruby On Rails’

No such file or directory - /tmp/mysql.sock

Sunday, August 10th, 2008
No Gravatar

Today I started messing around with Rails again, after having spent the best part of the last months on Merb.

Anyway the common link problem for the mysql adapter reared its ugly head as usual.
No such file or directory - /tmp/mysql.sock

The solution to this is to create a symbolic link from your mysqld.sock to /tmp/mysql.sock

But where is your mysqld.sock?

For Mac OSX it is usually in /opt/local/var/run/mysql5/mysqld.sock.
Check where it is with locate.

locate mysqld.sock

Now create the symlink:
ln -s /link/to/where/mysqld.sock /tmp/mysql.sock
on my Mac, I ran:
ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock

Facebook Connect

Wednesday, July 30th, 2008
No Gravatar

Facebook Connect came out on the 23rd of this month, and is a much modified and improved version of the notorious Facebook Beacon.

It allows external sites to authenticate a user and share detailed information including friendships, albums and personal profiles through facebook.

It is facebooks alternative to OpenSocial (and a little bit of OpenID), and it is going to be huge!

If you want a Facebook Connect application, or a Facebook application written in Ruby on Rails or Merb, give us a call.

Using submit_tag to pass parameters

Thursday, January 25th, 2007
No Gravatar

If you want to pass a parameter through a form, you don’t pass it through submit_tag, you pass it in start_form_tag. For example, I want to pass the value of id:
<%= start_form_tag :action => ‘create’, :id => @thisparticularid %>

This is much more secure than using a hidden field, for obvious reasons!

Ruby on Rails - HABTM relationships

Wednesday, January 24th, 2007
No Gravatar

Using has_and_belongs_to_many is great if you want to manage simple HABTM assoctions, although it provides no access as far as I am aware to other attributes if present in the join table. For a more complex join, you’ve gotta code it by hand.
I came across a bug with HABTM today. Do not add an id field to the join table, if you do, the habtm join table id will be populated to contain the id of your joined model, rather than an auto-incremented number.
This inevitably leads to problems! Check out the habtm reference here for more info.

Starting Work

Wednesday, January 10th, 2007
No Gravatar

After spending the summer developing a Ruby on Rails web 2.0 community app, I needed to pay the bills so I started work in December for Armstrong International as a Web developer in Ruby on Rails

I have found a sweet flat in Bayswater, London, and will be moving in as soon as possible!


nogeek.org is Digg proof thanks to caching by WP Super Cache!