gem 安装 mysql ...错误

发布于 2024-09-30 05:55:04 字数 1511 浏览 2 评论 0原文

安装 MySQL gem:

  $ export ARCHFLAGS="-arch i386 -arch x86_64"
  $ gem install mysql -- --with-mysql-config=/usr/local/bin/mysql_config

返回错误:

  ERROR:  While executing gem ... (NoMethodError)
  undefined method `spec' for nil:NilClass

我该如何修复它?

信息:

  $ brew list
  git       
  mysql     
  readline

  $ gem env
  RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-10
  - GEM PATHS:
     - /Library/Ruby/Gems/1.8
     - /Users/horace/.gem/ruby/1.8
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/

  $ which mysql
  /usr/local/bin/mysql

  $ gem list
  *** LOCAL GEMS ***
  brewbygems (0.3.1)
  sqlite3-ruby (1.3.2)

谢谢!

编辑:

dtruss 的输出: http://clomputing.com/temp/dtruss-gem -安装-mysql.txt

To install MySQL gem:

  $ export ARCHFLAGS="-arch i386 -arch x86_64"
  $ gem install mysql -- --with-mysql-config=/usr/local/bin/mysql_config

returns an error:

  ERROR:  While executing gem ... (NoMethodError)
  undefined method `spec' for nil:NilClass

How can I fix it?

Info:

  $ brew list
  git       
  mysql     
  readline

  $ gem env
  RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-10
  - GEM PATHS:
     - /Library/Ruby/Gems/1.8
     - /Users/horace/.gem/ruby/1.8
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - http://rubygems.org/

  $ which mysql
  /usr/local/bin/mysql

  $ gem list
  *** LOCAL GEMS ***
  brewbygems (0.3.1)
  sqlite3-ruby (1.3.2)

Thanks!

EDIT:

Output from dtruss: http://clomputing.com/temp/dtruss-gem-install-mysql.txt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

相思故 2024-10-07 05:55:04

对于 Ubuntu (Maverick),需要安装它

sudo apt-get install libmysqlclient-dev

,然后运行

sudo gem install mysql

其他发行版,首先

sudo apt-get install libmysqlclient-dev

检查 mysql_config 的位置 http:// packages.ubuntu.com/

并运行

sudo gem install mysql --with-mysql-config=path/to/mysql_config

For Ubuntu (Maverick) it is needed to install

sudo apt-get install libmysqlclient-dev

and after that run

sudo gem install mysql

for other diestribution, first

sudo apt-get install libmysqlclient-dev

and check where mysql_config is http://packages.ubuntu.com/

and run

sudo gem install mysql --with-mysql-config=path/to/mysql_config
轮廓§ 2024-10-07 05:55:04

也许尝试用 strace 运行它,看看问题是什么?

strace gem install mysql --with-mysql-config=/usr/local/bin/mysql_config

或者如果您使用的是 Mac OS X
dtruss gem install mysql --with-mysql-config=/usr/local/bin/mysql_config

Maybe try running it with strace and see what the problem is?

strace gem install mysql --with-mysql-config=/usr/local/bin/mysql_config

or if you're on Mac OS X
dtruss gem install mysql --with-mysql-config=/usr/local/bin/mysql_config

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文