Topic: Unable to connect to webrick server

Very new to Ruby / Rails, so please bear with me!

I'm working through the lynda.com 'Ruby on Rails 3 - Essential Training'.

I have Ruby, Rails and MySql set up as per the instructions. However, when I attempt to connect to the server by typing 'rails_server', I get the following error :

/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
    from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb:9
    from /Library/Ruby/Gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
    from /Users/dominicpoynter/Sites/simple_cms/config/application.rb:7
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:53
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.8/lib/rails/commands.rb:50
    from script/rails:6:in `require'
    from script/rails:6

Can anyone help solve this issue please?

Many thanks in advance,

Dom

Re: Unable to connect to webrick server

I am actually on the same tutorial although the last few days i've been doing some coding on my own as this is the 3rd rails tutorial i've worked through. Anyhow you need to do a db migration first. If you listen to the rest of that video they say if you run into this error to skip to chapter 6 or 7 and then come back. I just did that example with SQLite instead as it seems like using MySQL is fighting rails and i don't want to do that. Of course i haven't finished the demo app yet, so i'm not sure i'll be able to without using MySQL, but i see no reason why not. I figure if nothing else it'll be a little challenge to myself to adapt his code to SQLite.