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! While you're at it, check out some resources Treehouse students have shared here.

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 install mysql 2- Win7

Having some trouble getting mysql installed to begin working on the project in the Active Record course.

running the line: rails new biller -d mysql produces: ERROR: Failed to build gem native extension.

C:/Ruby200/bin/ruby.exe extconf.rb checking for ruby/thread.h... yes checking for rb_thread_call_without_gvl() in ruby/thread.h... yes checking for rb_thread_blocking_region()... yes checking for rb_wait_for_single_fd()... yes checking for rb_hash_dup()... yes checking for rb_intern3()... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lmygcc... no checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0. 3.16 for inspection. Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/ext/mysql2/g em_make.out An error occurred while installing mysql2 (0.3.16), and Bundler cannot continue.

Make sure that gem install mysql2 -v '0.3.16' succeeds before bundling.

After trying to run the suggested 'gem install mysql2 -v 0.3.16' I get the same error as above.

After perusing Google I'm left with a brain choc full of answers for posix users and squat for lonely windows.

2 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Sorry for the trouble Andrew Mosley! This post on Stack Overflow has some tips on installing the mysql2 gem on Windows. Maybe give those things a try and report back?

Hampton Catlin
STAFF
Hampton Catlin
Treehouse Guest Teacher

Yish! This doesn't sound like fun. Do you have Mysql installed on your machine? It's something you would have done in the Rails course or general Database course.