Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.