Unable to launch a application with mysql

I am new in ruby development and in the first lines, shit happens :smiley:
Normaly we pass trhougt the “Hello World”,but.

See i typed this lines to create and run my first project having a mysql
server installed on my OSX.

sudo gem install mysql2
sudo gem install rails
rails new blog -d mysql
cd blog
rails server

then happens this:

/Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle:
dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle,
9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from:
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle
Reason: image not found –
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.7/lib/mysql2.rb:9
from
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in
require’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:inrequire’
from
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in
each’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:inrequire’
from
/Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in
each’ from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:inrequire’
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in
require’ from /Users/titoleite4/Documents/Rails/blog/config/application.rb:7 from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/commands.rb:52:inrequire’
from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/commands.rb:52
from
/Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/commands.rb:49:in
tap’ from /Library/Ruby/Gems/1.8/gems/railties-3.1.1/lib/rails/commands.rb:49 from script/rails:6:inrequire’
from script/rails:6

Any help would be cool \0/.

Dude a did that,
installed the version 1.9.2
i configured as default version
installed gems rails mysql…

same problem.

On Oct 18, 2011, at 7:51 PM, Allan T. wrote:

I am new in ruby development and in the first lines, shit happens :smiley:
Normaly we pass trhougt the “Hello World”,but.

See i typed this lines to create and run my first project having a mysql
server installed on my OSX.

I and many other folks have had similar problems.

I suggest that you first install RVM - see http://beginrescueend.com/
and then reinstall using a single-user mode rather than system-wide.
See http://beginrescueend.com/rvm/install/ for details.

When installing system-wide it is far too easy to trip over components
from the OS X pre-installed version and things can turn ugly fast.

Blessedly, single-user supersedes the system-wide installation.

Dan N.

Thanks for help.

Problem solved doing this:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

On Oct 18, 2011, at 10:05 PM, Allan T. wrote:

Thanks for help.

Problem solved doing this:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

Welcome aboard!

On Oct 18, 2011, at 9:16 PM, Allan T. wrote:

Dude a did that,
installed the version 1.9.2
i configured as default version
installed gems rails mysql…

same problem.

Are you still getting error messages referring to
“/Library/Ruby/Gems/1.8/gems/…” with a single-user configuration?

If so, then you are erroneously using the multi-user components.

If not, what are the error messages now?

A couple of other thoughts -
Try a rails app using the default db (sqlite) just to see if that works.
Try connecting to your mysql server from the command line to make sure
that part is set up correctly as well.

Dan N.