Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Auto-populate Socket Value In Rails Database.yml Using TextMate Snippet

DZone's Guide to

Auto-populate Socket Value In Rails Database.yml Using TextMate Snippet

·
Free Resource
When using mysql for rails apps, you may need a socket: value. I can never remember mine. So I added a TextMate snippet to find it. (read below for non-TextMate)

Snippet text:


socket: `mysql_config --socket`


Activation: socket:

Scope selector: source.yaml - string

Usage:

In your database.yml, go to the line socket: , delete any blank spaces til the cursor is at the colon, then press TAB and wait. The line will be updated with the socket location.

Non-TextMate

If you don't have textmate, you can get your socket location using: mysql_config --socket And paste the result into your database.yml
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}