为了账号安全,请及时绑定邮箱和手机立即绑定

Rails,MySQL和Snow Leopard

Rails,MySQL和Snow Leopard

慕桂英3389331 2019-12-10 10:56:07
我使用在WWDC上获得的光盘升级到了雪豹。现在尝试运行我的一些Rails应用程序会抱怨sql    (in /Users/coneybeare/Projects/Ambiance/ambiance-server)!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.Importing all sounds in /Users/coneybeare/Projects/Ambiance/ambiance-sounds/Import 32/Compressed/ -- AdirondackPeepers.caf!!! 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!dlopen(/opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): Library not loaded: /usr/local/mysql/lib/libmysqlclient.16.dylib  Referenced from: /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle  Reason: image not found - /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle(See full trace by running task with --trace)我本可以发誓我曾经修复过这个问题。问题是sudo gem install mysql不起作用并给出错误: Building native extensions.  This could take a while...ERROR:  Error installing mysql:    ERROR: Failed to build gem native extension./opt/local/bin/ruby extconf.rb install mysqlchecking for mysql_query() in -lmysqlclient... nochecking for main() in -lm... yeschecking for mysql_query() in -lmysqlclient... nochecking for main() in -lz... yeschecking for mysql_query() in -lmysqlclient... nochecking for main() in -lsocket... nochecking for mysql_query() in -lmysqlclient... nochecking for main() in -lnsl... nochecking for mysql_query() in -lmysqlclient... noGem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out有没有人得到mysql在雪豹上使用Rails呢?如果是这样,您的设置是什么,更好的是,我该怎么做才能重现它?
查看完整描述

3 回答

?
慕容708150

TA贡献1831条经验 获得超4个赞

将mysql重建为64bit或安装64bit版本很重要,但是您还需要确保将mysql gem的本机部分也重建为64bit(如果您使用的是原始的Intel Core Duo macs,则该方法不适用)。


这是魔术命令:


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

每当在Snow Leopard上使用本机组件进行gem安装时,都应如上所述设置ARCHFLAGS。


查看完整回答
反对 回复 2019-12-10
?
繁星淼淼

TA贡献1775条经验 获得超11个赞

我为此花了很长时间,终于在Snow Leopard上使用它。我最终从源代码安装了Ruby,RubyGems和MySQL(有关安装Ruby和RubyGems的信息,请参见Hivelogic教程。MySQL教程位于底部。)我终于可以安装宝石了,但是我仍然在


dyld: lazy symbol binding failed: Symbol not found: _mysql_init

  Referenced from: /Library/Ruby/Site/1.8/universal-darwin10.0/mysql.bundle

  Expected in: flat namespace


dyld: Symbol not found: _mysql_init

  Referenced from: /Library/Ruby/Site/1.8/universal-darwin10.0/mysql.bundle

  Expected in: flat namespace


Trace/BPT trap

我终于删除了mysql.bundle(我不知道这是干什么的),这一切都奏效了。


sudo rm -f /Library/Ruby/Site/1.8/universal-darwin10.0/mysql.bundle

希望能对某人有所帮助。


查看完整回答
反对 回复 2019-12-10
  • 3 回答
  • 0 关注
  • 555 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信