-1

以下是我已经尝试找到答案的地方: 教程点stackoverflow另一个堆栈溢出官方指南

我仍然不知道我做错了什么。正确配置 database.yml 后,我尝试创建项目,这是我得到的错误:

“请更新您的 PATH 以包含构建工具或从“ http://rubyinstaller.org/downloads ”下载 DevKit,并按照“ http://github.com/oneclick/rubyinstaller/wiki/Development-Kit ”中的说明进行操作

安装 mysql2 (0.3.13) 时出错,Bundler 无法继续。gem install mysql2 -v '0.3.13'在捆绑之前确保成功。”

为什么找不到mysql2 v0.3.13?

操作系统:Windows 7 Rails:4.0.0 Ruby:已安装 1.9.3 DevKit

我遇到的错误 $ 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.`
4

1 回答 1

0
  • 关闭终端并再次打开。
  • cd到正确的目录。
  • 检查 ruby​​ 版本 ( ruby -v)。
  • 检查导轨版本bundle exec rails -v
  • 检查Gemfile存在。
  • 运行bundle
  • bundle exec rails s
于 2013-10-01T05:25:51.563 回答