Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby ActiveRecord Basics Migrations and Relationships Migrations

Can't generate the model

When I write

$rails g model Customer i receive a long error, i've not had this problem before, has anyone got a solution.

/Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18/lib/mysql2.rb:31:in require': dlopen(/Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/mysql2-0.3.18/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib Referenced from: /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/mysql2-0.3.18/mysql2/mysql2.bundle Reason: image not found - /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/mysql2-0.3.18/mysql2/mysql2.bundle (LoadError) from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18/lib/mysql2.rb:31:in<top (required)>' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:76:in require' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:76:inblock (2 levels) in require' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:72:in each' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:72:inblock in require' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:61:in each' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:61:inrequire' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler.rb:134:in require' from /Users/jameshibbeard/Development/Treehouse/world/config/application.rb:7:in<top (required)>' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:82:in require' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:82:inpreload' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:143:in serve' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:131:inblock in run' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:in loop' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:inrun' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in <top (required)>' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire' from /Users/jameshibbeard/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require' from -e:1:in<main>'