# Error with Rake

**URL:** <https://www.ruby-forum.com/t/error-with-rake/105199>\
**Category:** Ruby\
**Created:** [May 27, 2007, 2:27am UTC](https://www.ruby-forum.com/t/error-with-rake/105199 "2007-05-27T02:27:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremyheiler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Post date:** [May 27, 2007, 2:27am UTC](https://www.ruby-forum.com/t/error-with-rake/105199/1 "2007-05-27T02:27:06Z")

</div>

I receive this error when running a rake command:

$ rake db:migrate  
(in /Users/jeremy/rails/depot)  
dyld: NSLinkModule() error  
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.  
15.dylib  
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/  
mysql.bundle  
Reason: image not found  
Trace/BPT trap

I’m working with the book “Agile Web D. with Rails” and even  
though it discusses many possible errors, none of them relate to this  
one. Also, my database.yml file seems to be correct so I don’t think  
that’s the problem.

---

<div class="post-metadata">

**Author:** ![jeremyheiler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Post date:** [May 27, 2007, 5:38am UTC](https://www.ruby-forum.com/t/error-with-rake/105199/2 "2007-05-27T05:38:20Z")

</div>

On May 26, 2007, at 8:26 PM, Jeremy H. wrote:

> Trace/BPT trap
> 
> I’m working with the book “Agile Web D. with Rails” and  
> even though it discusses many possible errors, none of them relate  
> to this one. Also, my database.yml file seems to be correct so I  
> don’t think that’s the problem.

Well I discovered the diagnoses but not the cure. My “libmysqlclient.  
15.dylib” file is located in “/usr/local/mysql/lib” instead of “/usr/  
local/mysql/lib/mysql”. I opened up the “mysql.bundle” file in vi but  
it was complete chaos. I could see where to make the change but it  
didn’t look safe to edit the file. What do I do?

---

<div class="post-metadata">

**Author:** ![jeremyheiler](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Post date:** [June 2, 2007, 7:21pm UTC](https://www.ruby-forum.com/t/error-with-rake/105199/3 "2007-06-02T19:21:26Z")

</div>

Hi Jeremy (and all others experiencing the same problems),

I found the following solution to this problem:

Fire up the Terminal then type

> cd /usr/local/mysql/lib  
> sudo mkdir mysql  
> Password: \*\*\*\*\*\*\*\*\*\*\*\*\*  
> cd mysql/  
> sudo ln -s …/libmysqlclient.15.0.0.dylib libmysqlclient.15.0.0.dylib  
> sudo ln -s …/libmysqlclient.15.0.0.dylib libmysqlclient.15.dylib  
> sudo ln -s …/libmysqlclient.15.0.0.dylib libmysqlclient.dylib

This will create some symbolic links from the expected location of these  
files to the current location.

Inspired by  
[http://blog.calganx.net/2007/05/20/apache-2-php-5-und-mysql-5-fr-macos-x/](http://blog.calganx.net/2007/05/20/apache-2-php-5-und-mysql-5-fr-macos-x/)

This seems to be related to a change in the directory structure of the  
current mysql releases?! But I did not investigate any further.

greetings

```
Sascha

```
