MongoDB SpiderMonkey 不理解 UTF-8
如果我将非 ASCII 字符添加到 MongoDB 数据库,则所有 db.find() 都会失败,告诉“检测到非 ASCII 字符”。
这是SpiderMonkey的问题,我必须用UTF-8支持重建它。 我尝试这样做 http://www.mongodb.org/display/DOCS/Building+Spider+Monkey
但它不起作用(在我完成所有步骤后,SpiderMonkey 未安装)。
我有 Ubuntu 11.04。有人知道如何让它工作那里吗?
如何让 MongoDB 与 Google V8 一起工作的工作指导也可以提供帮助。
If I add non-ASCII characters to MongoDB database then all db.find() fail telling "non ascii character detected".
It's problem of SpiderMonkey, I have to rebuild it with UTF-8 support.
I've tried to do it like in
http://www.mongodb.org/display/DOCS/Building+Spider+Monkey
but it doesn't work (SpiderMonkey is not installed after I've completed all steps).
I've got Ubuntu 11.04. Does anybody have instruction how to make it work there?
Working instruction how to make work MongoDB with Google V8 can also help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 Ubuntu Server 11.04 上使用 MongoDB,使用以下指令安装新操作系统后安装它: http ://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
开箱即用,一切正常。从头开始构建 MongoDB 对您来说至关重要吗?
I'm using MongoDB on Ubuntu Server 11.04, installed it after making fresh OS install using this instruction: http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
Everything is working fine out of the box. Is it critical for you to build MongoDB from scratch?
使用 10gen 发布的软件包工作正常,但如果您确实想从支持 UFT-8 的源代码编译 SpiderMonkey:
然后按照 https://developer.mozilla.org/En/SpiderMonkey/Build_Documentation
这将安装到 /usr/local/lib 中,但是mongodb 包在 /usr/lib (安装了 Spidermonkey 包的位置)中查找它。因此,我们将安装到 /usr/lib 的所有文件链接到 /usr/local /lib
当然,您可以将它们移动到 /usr/lib 而不是符号链接,但我想让支持 utf 的库远离默认位置,防止与默认的spidermonkey包冲突。如果没有安装 libmozjs 软件包,apt 会抱怨 mongodb 的依赖关系不满足,所以我保留了它的安装状态。
请记住,如果 Spidermonkey 软件包升级,它可能会覆盖新库的符号链接(或者库本身,如果您已将它们移至 /usr/local/lib)。理想的解决方案是构建自己的包来永久解决依赖问题。
Using the 10gen-published packages works fine, but if you actually want to compile SpiderMonkey from source with UFT-8 support:
And then follow the instructions from https://developer.mozilla.org/En/SpiderMonkey/Build_Documentation
This will install into /usr/local/lib, however the mongodb package looks for it in /usr/lib (where the spidermonkey package is installed). So, we link all files installed to /usr/local /lib from /usr/lib
Of course you could just move them into /usr/lib instead of symlinking, but I wanted to keep the utf-enabled libs away from the default location, to prevent conflicts with the default spidermonkey package. Without the libmozjs package installed, apt complains that dependencies for mongodb are not satisfied, so I've left it installed.
Keep in mind that if the spidermonkey package gets upgraded, it can overwrite the symlinks to our new libs (or the libs themselves if you've moved them to /usr/local/lib). The ideal solution would be to build your own package to solve dependency issues for good.