osx 10.6.8上的mysql gem出现问题

达克斯

我正在将我的数据库从sqlite更新到mySQL(@ mu太短了……我知道。我知道。我应该在一开始就做完)并遇到问题。

到目前为止的过程如下:

步骤1:

更新的database.yml和运行耙分贝:模式:负荷按

rake aborted!
Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)

第2步:

rvm @global do gem install mysql

Fetching: mysql-2.9.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.

    /Users/charliekim/.rvm/rubies/ruby-2.0.0-p247/bin/ruby 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... yes
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... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
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
    --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=/Users/charliekim/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
    --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}/
    --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
    --with-mygcclib
    --without-mygcclib
    --with-mysqlclientlib
    --without-mysqlclientlib


Gem files will remain installed in /Users/charliekim/.rvm/gems/ruby-2.0.0-p247@global/gems/mysql-2.9.1 for inspection.
Results logged to /Users/charliekim/.rvm/gems/ruby-2.0.0-p247@global/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

第三步:

搜索SO =>无法在Mac OS X上安装mysql gem

此答案中的解决方案不起作用,因为其中没有mySQL目录,/usr/local因此我无法在其中编辑代码。

第4步:

的输出mkmf.log=> http://pastebin.com/7qSdv73R
的输出gcc -v=>

Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)

编辑1:

我也跑了:gem install activerecord-mysql-adapter

返回:

Fetching: mysql-2.9.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed mysql-2.9.1
Fetching: i18n-0.6.5.gem (100%)
Successfully installed i18n-0.6.5
Fetching: atomic-1.1.13.gem (100%)
Building native extensions.  This could take a while...
Successfully installed atomic-1.1.13
Fetching: thread_safe-0.1.2.gem (100%)
Successfully installed thread_safe-0.1.2
Fetching: activesupport-4.0.0.gem (100%)
Successfully installed activesupport-4.0.0
Fetching: activerecord-mysql-adapter-0.0.1.gem (100%)
Successfully installed activerecord-mysql-adapter-0.0.1
Fetching: builder-3.1.4.gem (100%)
Successfully installed builder-3.1.4
Fetching: activemodel-4.0.0.gem (100%)
Successfully installed activemodel-4.0.0
Fetching: arel-4.0.0.gem (100%)
Successfully installed arel-4.0.0
Fetching: activerecord-deprecated_finders-1.0.3.gem (100%)
Successfully installed activerecord-deprecated_finders-1.0.3
Parsing documentation for mysql-2.9.1
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/mysql/mysql_api.bundle, skipping
Installing ri documentation for mysql-2.9.1
Parsing documentation for i18n-0.6.5
Installing ri documentation for i18n-0.6.5
Parsing documentation for atomic-1.1.13
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/atomic_reference.bundle, skipping
Installing ri documentation for atomic-1.1.13
Parsing documentation for thread_safe-0.1.2
Installing ri documentation for thread_safe-0.1.2
Parsing documentation for activesupport-4.0.0
unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/active_support/values/unicode_tables.dat, skipping
Installing ri documentation for activesupport-4.0.0
Parsing documentation for activerecord-mysql-adapter-0.0.1
Installing ri documentation for activerecord-mysql-adapter-0.0.1
Parsing documentation for builder-3.1.4
/Users/charliekim/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: Unsupported encoding : ignored
/Users/charliekim/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: Unsupported encoding  ignored
Installing ri documentation for builder-3.1.4
Parsing documentation for activemodel-4.0.0
Installing ri documentation for activemodel-4.0.0
Parsing documentation for arel-4.0.0
Installing ri documentation for arel-4.0.0
Parsing documentation for activerecord-deprecated_finders-1.0.3
Installing ri documentation for activerecord-deprecated_finders-1.0.3
10 gems installed

但是运行时我仍然遇到相同的错误rake db:schema:load

Rake aborted!
Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)
...

编辑2:

这里是database.yml

development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: db/development
  pool: 5
  username: [name]
  password: [password]
  socket: /tmp/mysql.sock
test:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: db/test
  pool: 5
  username: [name]
  password: [password]
  socket: /tmp/mysql.sock

production:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: db/production
  pool: 5
  username: [name]
  password: [password]
  socket: /tmp/mysql.sock

我添加gem "mysql"gemfile,现在出现错误

rake aborted!
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

我不知道这些套接字应该是什么,我根据一个SO帖子填充了它们,所以这可能是问题的一部分。

ƒtƒ

移动评论来回答。

1.)回答Please install the mysql adapter: gem install activerecord-mysql-adapte (mysql is not part of the bundle. Add it to Gemfile.)

ANS:在您的database.yml文件中,适配器应为mysql2而不是mysql

2.) rake aborted! Can't connect to local MySQL server through socket /tmp/mysql.sock (2)

ANS:使用命令查找确切的套接字文件

mysqladmin variables | grep socket

如果您具有root用户密码,请执行

mysqladmin -pxxxx variables | grep socket

您将使用上述命令获取套接字文件,并将其替换为您的database.yml文件

干杯。!!

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在Mac OSX上启动MySQL时出现问题

来自分类Dev

使用pip在OSX上安装pyspatialite时出现问题

来自分类Dev

在Windows 10上安装Kivy时出现问题

来自分类Dev

在Windows 10 Home上设置KUBECTL时出现问题

来自分类Dev

在Windows 10上安装Tensorflow时出现问题

来自分类Dev

在Windows 10上观看视频时出现问题

来自分类Dev

在Windows 10上安装Ubuntu 16.04时出现问题

来自分类Dev

在新的Centos 6版本上启动MySQL时出现问题

来自分类Dev

在Mac OSX 10.9.4上安装Ruby 1.9.3时出现问题

来自分类Dev

在OSX 10.9.2 Mavericks(混乱的系统上)重新安装ruby 1.9.3时出现问题

来自分类Dev

在OSX Mavericks上安装Ruby on Rails时libxml2出现问题

来自分类Dev

iOS 6上每个组件的UIPickerView固定标签出现问题

来自分类Dev

在Laravel 6上从Maddhatter / laravel-fullcalendar安装软件包时出现问题

来自分类Dev

在Windows 10上为PyPy3安装numpy时出现问题

来自分类Dev

使用Android 10在pdf应用程序上显示pdf文件时出现问题

来自分类Dev

在Windows 10上安装BootCamp驱动程序时出现问题

来自分类Dev

在BQ M10上创建lxc容器时出现问题

来自分类Dev

在Windows 10 Pro上安装Hyper-V功能时出现问题

来自分类Dev

OSX上的DMD问题

来自分类Dev

OSX 10.11.3上Ruby的MySQL 5.7.10问题

来自分类Dev

在OSX 10.8.5上安装XCode 6

来自分类Dev

安装mysqlworkbench 6时出现问题

来自分类Dev

安装mysqlworkbench 6时出现问题

来自分类Dev

通过RDP将OSX转换为Win10,在OSX上增加Win10音频

来自分类Dev

OSX Mavericks上的locloc问题

来自分类Dev

OSX Mavericks上的locloc问题

来自分类Dev

在Windows 8上刻录Live CD时出现问题

来自分类Dev

iOS 8中的CLlocationManager出现问题

来自分类Dev

在Mavericks上使用Homebrew安装MySQL时出现问题

Related 相关文章

  1. 1

    在Mac OSX上启动MySQL时出现问题

  2. 2

    使用pip在OSX上安装pyspatialite时出现问题

  3. 3

    在Windows 10上安装Kivy时出现问题

  4. 4

    在Windows 10 Home上设置KUBECTL时出现问题

  5. 5

    在Windows 10上安装Tensorflow时出现问题

  6. 6

    在Windows 10上观看视频时出现问题

  7. 7

    在Windows 10上安装Ubuntu 16.04时出现问题

  8. 8

    在新的Centos 6版本上启动MySQL时出现问题

  9. 9

    在Mac OSX 10.9.4上安装Ruby 1.9.3时出现问题

  10. 10

    在OSX 10.9.2 Mavericks(混乱的系统上)重新安装ruby 1.9.3时出现问题

  11. 11

    在OSX Mavericks上安装Ruby on Rails时libxml2出现问题

  12. 12

    iOS 6上每个组件的UIPickerView固定标签出现问题

  13. 13

    在Laravel 6上从Maddhatter / laravel-fullcalendar安装软件包时出现问题

  14. 14

    在Windows 10上为PyPy3安装numpy时出现问题

  15. 15

    使用Android 10在pdf应用程序上显示pdf文件时出现问题

  16. 16

    在Windows 10上安装BootCamp驱动程序时出现问题

  17. 17

    在BQ M10上创建lxc容器时出现问题

  18. 18

    在Windows 10 Pro上安装Hyper-V功能时出现问题

  19. 19

    OSX上的DMD问题

  20. 20

    OSX 10.11.3上Ruby的MySQL 5.7.10问题

  21. 21

    在OSX 10.8.5上安装XCode 6

  22. 22

    安装mysqlworkbench 6时出现问题

  23. 23

    安装mysqlworkbench 6时出现问题

  24. 24

    通过RDP将OSX转换为Win10,在OSX上增加Win10音频

  25. 25

    OSX Mavericks上的locloc问题

  26. 26

    OSX Mavericks上的locloc问题

  27. 27

    在Windows 8上刻录Live CD时出现问题

  28. 28

    iOS 8中的CLlocationManager出现问题

  29. 29

    在Mavericks上使用Homebrew安装MySQL时出现问题

热门标签

归档