Request To All Tutorial Writers 1

Posted by Justin Reagor Thu, 10 Jul 2008 01:09:00 GMT

From now on, if your writing this…
git clone git://github.com/sam/extlib.git  
git clone git://github.com/sam/do.git

cd extlib
rake install ; cd ..
cd do
cd data_objects
rake install ; cd ..
cd do_mysql  # || do_postgres || do_sqlite3
rake install

Instead, tell your readers to do this…

git clone git://github.com/sam/extlib.git  
git clone git://github.com/sam/do.git

cd extlib
***rake spec***
rake install ; cd ..
cd do
cd data_objects
***rake spec***
rake install ; cd ..
cd do_mysql  # || do_postgres || do_sqlite3
rake install

Make sure that your running specs that are passing before installing edge software.

Here’s another tip, if your trying to learn new software… or wondering why something isn’t working for you… check the specs! They are a great place to learn just exactly how the author approaches using the libraries they write.

Bad do_mysql-0.2.2 Gem 4

Posted by Justin Reagor Fri, 07 Dec 2007 04:04:00 GMT

If your getting this error whilst attempting to load up DataMapper in Merb (the rake dm:install:mysql portion, or just gem install do_mysql). Here’s how I fixed it…

Started merb_init.rb ...
Loading dependencies...
dyld: NSLinkModule() error
dyld: Library not loaded: /opt/local/lib/mysql5/mysql/libmysqlclient_r.15.dylib
  Referenced from: /usr/local/lib/ruby/gems/1.8/gems/do_mysql-0.2.2/lib/mysql_c.bundle
  Reason: image not found
Trace/BPT trap

Try this…

# sudo -s
# cd /usr/local/lib/ruby/gems/1.8/gems/do_mysql-0.2.2/ext
# make clean
# vim mysql_c.i
[change any bad paths to correct mysql locations in your OS]
# make all
# rm ../lib/mysql_c.bundle
# cp mysql_c.bundle ../lib

DataMapper with MySQL should now work in Merb! Happy hacking once more…