2013-01-13 24 views
0

,所以我有一個很大的問題,我想用Rails 2.3.11和1.8.7紅寶石冷杉我安裝我的SQLmysql安裝在Ubuntu和耙分貝:創建

gem install mysql 

然後我運行啓動一個項目

rake db:create 

,但我的一些搜索我發現那位的溶液中,因爲運行這些命令卸載MySQL的一個後得到一個錯誤

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) 

次運行此行

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 

我試圖爲過去兩天請幫我我制動器前我的筆記本電腦在此先感謝。

+0

的可能重複的解決了這個問題[MySQL的安裝:錯誤:未能建立寶石原生擴展(http://stackoverflow.com/questions/2167598/MySQL的安裝錯誤,未能對集結寶石原生擴展) – lucapette

回答

0

我已經

gem uninstall mysql 
export PATH=$PATH:/usr/local/mysql/bin 
sudo gem install mysql