Mar 7 2009

Installing mysql ruby gem

Having problems installing the mysql ruby gem?

Locate your mysql_config file and then pass it in the mysql config when you install the mysql gem.

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql-5.1.32-osx10.5-x86/bin/mysql_config

That should address the following error:
sudo gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib


Jan 24 2009

Ruby on Rails Tutorials

Looking for some Ruby and Rails Tutorials?

Check out http://webdeveloper.econsultant.com/ruby-rails-tutorials/


Helpful Ruby on Rails tutorials.

  1. AJAX powered chat in 3 hours on Ruby on Rails : Tutorial on creating simple Web chatroom
  2. Ajax on Rails : at ONLamp
  3. Beginner’s Guide to Rails, part 1 : series of tutorials at GodBit
  4. Building Ruby, Rails, LightTPD, and MySQL on Tiger : at Hivelogic
  5. Create a To Do List with Ruby on Rails – Beginner’s Tutorial : at thehua
  6. Distributing Rails Applications – A Tutorial : by Erik Veenstra
  7. Fast-track your Web apps with Ruby on Rails : at IBM
  8. Four Days on Rails : Tutorial in PDF at HomeLinux
  9. Getting Your Feet Wet With Ruby on Rails : at Webmonkey
  10. Installing Ruby on Rails with Lighttpd and MySQL on Fedora Core 4 : at DigitalMediaMinute
  11. Instant Rails : preconfigured Rails software
  12. Introduction to Ruby : for Perl programmers at SixBit
  13. Introduction to Ruby for Mac OS X : at IO
  14. Learning Ruby : by Daniel Carrera
  15. Many to Many Tutorial for Rails (PDF) : at JRHicks
  16. ObjectiveView Ruby on Rails Introduction (PDF) : at Ratio
  17. Really Getting Started in Rails : at Slash7
  18. Rolling with Ruby on Rails (Part1) : at ONLamp
  19. Rolling with Ruby on Rails, Part 2 : at ONLamp
  20. Ruby on Rails : at RegDeveloper.co.uk
  21. Ruby on Rails on Oracle: A Simple Tutorial : at Oracle
  22. Ruby on Rails Screencasts : at RubyOnRails
  23. Try Ruby : Try Ruby in the browser at Hobix
  24. Tutorial : a basic tutorial at RubyOnRails
  25. Really Getting Started in Rails : Despite being written back all the way back in January 2005, Amy Hoy’s short and sweet intro still manages to be relevant
  26. Rails for Designers : by Kevin Clark
  27. Ruby QuickRef : quick reference guide.
  28. Ruby Tutorials : at Tutorialized.com
  29. Using Ruby on Rails for Dev on Mac OSX : at Apple
  30. How to Build a Ruby on Rails Engine: In-depth Start-to-Finish Tutorial : at AlterLabs

Related Posts:

  1. Ruby on Rails Basics (9 links) : Software / services to help in PHP.
  2. Ruby on Rails Blogs (10 links) : Blogs featuring articles, codes and discussions on Ruby.
  3. Ruby on Rails Demos Exampls Code Samples (29 links) : s
  4. Ruby on Rails Hosts (238 links) : Web hosts supporting Ruby.
  5. Ruby on Rails Official Sites (3 links) : Official sites for Ruby developers.
  6. Ruby on Rails Projects Sites (346 links) : Projects and sites developed using Ruby.
  7. Ruby on Rails Tutorials (29 links) : Helpful Ruby on Rails tutorials.

Dec 4 2008

Vim: Turn code into HTML

Maciej on his blog talks about an interesting feature in vim.

You can save highlighted source to a HTML file.
:runtime! syntax/2html.vim

So you can go from something like this:

Ruby Code in Vim

Ruby Code in Vim

To a html file like this:

Ruby Code in HTML

Ruby Code in HTML


Nov 3 2008

Bluetooth Devices

For those looking into bluetooth devices, a friend of mine recently went through the hassle of finding his perfect bluetooth headset.

The hardest part, for me, was getting the audio transmitter. That’s where avrcp (AV remote control) bit me, because i didn’t know it was a separate profile from a2dp (stereo bluetooth) and then in addition, you’ve got class 1 and class 2 bluetooth devices. class 2 are the “default”, but the range is fairly short and microwave ovens disturb it at work

i switched to a class 1 device, and now i can go upstairs and still have music. Then on top of class 1 and avrcp, you also have to know what media players it supports for the avrcp

(the bluetooth stack, rather; not specifically the transmitter) but the transmitter i got used the toshiba bluetooth stack, which has avrcp but only for a handful of players (not itunes) so if one were to buy a bluetooth audio transmitter, i would say: a2dp, avrcp, class 1, and comes with the bluesoleil bluetooth stack…for windows. i just realized macs probably have builtin a2dp/avrcp and would certainly be compat with itunes.

the specific headset i have is the Sony DR-BT22 and i don’t have any major complaints. music sounds good, it’s reasonably comfortable, and it’s got good battery life. It does have a flimsy feel to it because it’s foldable, but it doesn’t bother me.

the transmitter i have (for the pc) is a Zoom class 2 bluetooth 2. it works as advertised, but i don’t necessary recommend it. it came w/ the toshiba bluetooth stack, which doesn’t work with itunes. so i like the stats of the zoom, but i’d recommend a transmitter that comes w/ the blue soleil stack instead (since it works with itunes).


Oct 9 2008

Skype Regex FTW!

When messaging through Skype, it’s not unusual for geeks to write a little bit of regular expression to correct mistakes.

Example:
rubyconsumer> I like kake!
rubyconsumer> s/kake/cake/

Well it looks like the Skype client for the mac has taken this one step further.  And for once, the mac client is actually ahead of the windows client.

An up to date Skype client will now take that regex and run it against your last message.  The resulting message from the previous example would look like:

Example:
Editted: 10/9/08 7:30AM – rubyconsumer
rubyconsumer> I like cake!

Now that’s Geek Accessibility!

Now if only video sites like youtube would add key board shortcuts…

Blogged with the Flock Browser

Jul 8 2008

Full Finder Paths

I really love OS X. Things are done right or can be easily changed… for the most part.

A few though, need to be configured through secret command line incantations.

I’ve finally ran across a way to add the full path of the directory into the Finder.

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

Restart the Finder and volia!

There are more customizations available from the command line here.


Jul 7 2008

Menu ShortCut for Leopard

I ran across a great menu shortcut on Leopard.

Cmd-Shift-/ (aka. Cmd-?)

Now just type in your menu command and the result comes up like quicksilver/spotlight.

Hit enter and volia!

use help to select menu items in leopard


Jul 2 2008

Faster Gem Docs

A few weekends ago, I was at Ann Arbor Startup Weekend. It was a great weekend. We had a functional alpha/beta at the end of the weekend. This was despite the, to put it mildly, congested wifi.

A lot of folks are very reliant on the internet for information. Understandably so, but it doesn’t work in a weak and no wifi situation.

Using gem_server to get your documentation each time seems like a lot of work.

Enter Bashfully Yours, Gem Shortcuts.

By setting up my bash to load up gem documentation, I’m able to get documentation faster then you can off the web.

gemdoc hpricot

Done!

Try it out. It might even inspire you to help out with documenting a few gems.


Jul 1 2008

Block Mode Editting

I’ve been a long time VI user. Not a vi-ninja but definitely comfortable using the vi methodology.

Having used Block Mode editting in Textmate, I really needed to find a way to do the same in vi.

Volia!

Ctrl-V with ‘c’, ‘I’, and ‘A’ are the magic commands in vi

Vim Block Visual Mode


Jul 1 2008

Setting Up Unix Profiles In A Diverse Environment

I’ve recently made changes to my bash profile after getting sick and tired of managing multiple environments in one profile.

› Continue reading