-1

Here are the places I have already tried to find the answer: tutorials point, stackoverflow, another stack overflow, and the official guide.

I still have no idea what I am doing wrong. After I have configured the database.yml correctly, I try to create the project and this is the error I get:

"Please update your PATH to include build tools or download the DevKit from 'http://rubyinstaller.org/downloads' and follow the instructions at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

An error occurred while installing mysql2 (0.3.13), and Bundler cannot continue. Make sure that gem install mysql2 -v '0.3.13' succeeds before bundling."

Why can't I find mysql2 v0.3.13?

OS: Windows 7 Rails: 4.0.0 Ruby: 1.9.3 DevKit installed

Errors that I have encountered $ bundle exec rails s Could not locate Gemfile

$ bundle Bundler::GemfileNotFound

`$ gem install mysql2
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

        c:/Ruby193/bin/ruby.exe extconf.rb
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
*** 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.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=c:/Ruby193/bin/ruby
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
extconf.rb:37:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)


Gem files will remain installed in c:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.13 for inspection.`
Community
  • 1
  • 1
HighHopes
  • 2,014
  • 3
  • 23
  • 33
  • I have installed the latest version of MySQL which is 5.x or 6. I don't know how to find out. Rails keeps saying that it can't find mysql2 gem. – HighHopes Oct 01 '13 at 04:41
  • This is what is in my Gemfile: `# Use mysql as the database for Active Record gem 'mysql2'`. When I run bundle this is the output:`Bundler::GemfileNotFound` – HighHopes Oct 01 '13 at 04:49
  • 1
    Close terminal and open again. `cd` to the correct directory. check ruby version (`ruby -v`). check rails version `bundle exec rails -v`. check `Gemfile` exists. run `bundle`. run `bundle exec rails s`. if any of these checks fail, edit the question and tell us exactly what is wrong. copy-paste actual errors that you see. – Zabba Oct 01 '13 at 05:01
  • None of those worked and I pasted the errors on an edit. Should there be more that I need to post? – HighHopes Oct 01 '13 at 05:06
  • Please see how to format text as code. The text you pasted is not readable otherwise. – Zabba Oct 01 '13 at 05:09
  • If none of those things worked, you need to get them working before doing anything else. – Zabba Oct 01 '13 at 05:11
  • I got them to work! It changed mysql2 versions on me. Now it installed version 0.2.6 instead of 0.3.13. What does that mean? – HighHopes Oct 01 '13 at 05:14
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/38384/discussion-between-casey-and-zabba) – HighHopes Oct 01 '13 at 05:14

1 Answers1

0
  • Close terminal and open again.
  • cd to the correct directory.
  • check ruby version (ruby -v).
  • check rails version bundle exec rails -v.
  • check Gemfile exists.
  • run bundle.
  • run bundle exec rails s
Zabba
  • 64,285
  • 47
  • 179
  • 207
  • It turned out that I wasn't in the right directory and I had to run all of these commands once I was. What does `bundle exec rails s` do? – HighHopes Oct 01 '13 at 15:20