evan__zhang 2009-06-24 12:06
浏览 242
已采纳

在线急求,,关于ubuntu安装mysql的问题

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)
请问为什么,怎么解决?

  • 写回答

4条回答 默认 最新

  • laitaogood 2009-06-24 17:24
    关注

    Table 'activation_states' already exists
    你在创建表的时候,这个表已经存在了啊,当然报错
    先确保数据库中没有多余的表了哦

    删除MySQL,试试下面的命令
    [code="c"]sudo apt-get remove mysql
    sudo apt-get autoremove[/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导
  • ¥15 docker模式webrtc-streamer 无法播放公网rtsp
  • ¥15 学不会递归,理解不了汉诺塔参数变化
  • ¥15 基于图神经网络的COVID-19药物筛选研究
  • ¥30 软件自定义无线电该怎样使用