sudo gem install mysql
然后显示
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
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... yes
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.
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=/usr/bin/ruby1.8
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
为什么?
另
rake db:create时,!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql
(See full trace by running task with --trace)
我的gem:
actionmailer (2.3.2, 2.2.2)
actionpack (2.3.2, 2.2.2)
activerecord (2.3.2, 2.2.2)
activeresource (2.3.2, 2.2.2)
activesupport (2.3.2, 2.2.2)
rails (2.3.2, 2.2.2)
rake (0.8.7)
rubygems-update (1.3.4)
没有mysql.cnf
zlib1g 1:1.2.3.3.dfsg-12ubuntu2(已装)
zlib1g-dev 1:1.2.3.3.dfsg-12ubuntu1(装不上去,)
,怎么样才能把mysql给弄好?
[b]问题补充:[/b]
如果用
sudo apt-get install mysql
则会显示E: 无法找到软件包 mysql
[b]问题补充:[/b]
那驱动呢,现在我只是想怎么解决我上面的问题啊,如果不行,怎么卸载我的mysql
sudo gem uninstall mysql 没有用
[b]问题补充:[/b]
迁移数据库时,出现
rake aborted!
An error has occurred, all later migrations canceled:
Mysql::Error: Table 'activation_states' already exists: CREATE TABLE activation_states
(id
int(11) DEFAULT NULL auto_increment PRIMARY KEY, show_name
varchar(10)) ENGINE=InnoDB
(See full trace by running task with --trace)
请问为什么,怎么解决?
Table 'activation_states' already exists
你在创建表的时候,这个表已经存在了啊,当然报错
先确保数据库中没有多余的表了哦
删除MySQL,试试下面的命令
[code="c"]sudo apt-get remove mysql
sudo apt-get autoremove[/code]
我在ubuntu安装的时候都是按以下方式来安装的哦
sudo apt-get install mysql
刚好下面这篇文章可以帮你啊
[url]http://letle.iteye.com/blog/258664[/url]
不会吧,我一直都是这么装的哦
要不你更新一下源吧
应该是
sudo apt-get install mysql-client
sudo apt-get install mysql-server
喜欢直观的话,可以使用新立得软件管理器来安装。