所以我有一个大问题我想开始使用 rails 2.3.11 和 ruby 1.8.7 firs 我安装了我的 sql
gem install mysql
然后我跑
rake db:create
但我有一个错误
Couldn't create database for {"adapter"=>"mysql", "database"=>"test_development", "encoding"=>"utf8", "reconnect"=>false, "username"=>"root", "pool"=>5, "host"=>"localhost", "password"=>nil}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation)
经过一番搜索,我找到了一个解决方案来运行这些命令,我卸载 mysql 并运行这些行
gem install mysql -- --with-mysql-dir=/usr/local \ --with-mysql-config=/usr/local/bin/mysql_config
但我遇到了另一个错误
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/home/asnad/.rvm/rubies/ruby-1.8.7-p370/bin/ruby extconf.rb --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/bin/mysql_config
extconf.rb:5: command not found: /usr/local/bin/mysql_config --cflags
*** 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=/home/asnad/.rvm/rubies/ruby-1.8.7-p370/bin/ruby
--with-mysql-config
我正在尝试过去两天,请在我刹车笔记本电脑之前帮助我提前谢谢。