简体   繁体   English

雪豹,sqlite3-ruby

[英]Snow Leopard, sqlite3-ruby

So I followed every suggestion in this thread 所以我遵循了这个主题中的每一个建议

without success. 没有成功。 I'm running os x 10.6, rails 2.3.3, ruby 1.9.1 and still getting this error when I try accessing the front page of my rails app: 我正在运行os x 10.6,rails 2.3.3,ruby 1.9.1,当我尝试访问我的rails应用程序的首页时仍然出现此错误:

uninitialized constant SQLite3::Driver::Native::Driver::API 未初始化的常量SQLite3 :: Driver :: Native :: Driver :: API

I've googled every possible combination of snow leopard, rails, sqlite3 without any luck. 我用Google搜索了所有可能的雪豹,铁轨,sqlite3组合,没有任何运气。 Hoping someone can help. 希望有人可以提供帮助。 Thanks! 谢谢!

I finally solved this by recompiling ruby 1.9.1 with the appropriate sqlite3 libraries linked. 我终于通过重新编译ruby 1.9.1并使用相应的sqlite3库链接来解决这个问题。 So in my case I needed to create this link: 所以在我的情况下,我需要创建此链接:

sudo ln -s  /Developer/SDKs/MacOSX10.6.sdk/usr/lib/libsqlite3.0.dylib /usr/local/lib/libsqlite3.dylib

或者,简单地说

sudo gem install sqlite3-ruby

很奇怪,但是我卸载了所有的Sqlite3版本并重新安装了Sqlite3并且它工作正常。

ennuikillers' answer worked for me. ennuikillers的回答对我有用。 I'll add that I did this on a mac (running snow leopard) and /usr/local/lib/libsqlite3.dylib already existed and was symlinked to the wrong thing. 我将添加我在mac(运行雪豹)和/usr/local/lib/libsqlite3.dylib已经存在并且符号链接到错误的东西。

I had to add the line: sudo rm /usr/local/lib/libsqlite3.dylib 我不得不添加这行:sudo rm /usr/local/lib/libsqlite3.dylib

before the symlink line. 在符号链接行之前。

I had a similar thing happen on an older Ubuntu server (6.06), on which I had installed SQLite from source. 我在旧的Ubuntu服务器(6.06)上发生了类似的事情,我在源服务器上安装了SQLite。 There was no ld.so.conf file so I had to create that and add /usr/local/lib to it. 没有ld.so.conf文件所以我必须创建它并添加/ usr / local / lib。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM