【问题标题】:Fresh RVM Installation on OS X, not able to run server due to sqlite3 issuesOS X 上的全新 RVM 安装,由于 sqlite3 问题而无法运行服务器
【发布时间】:2013-04-16 23:41:13
【问题描述】:

我在我的 Mac OS X 10.6.8(运行 Snow Leopard)上安装了 rvm 并尝试启动我的第一个示例应用程序。在摆弄了几个小时后,我决定在这里发布这个问题,因为我真的不知道如何解决这个问题:

每当我尝试在我的应用程序文件夹中运行开发服务器时,都会收到以下错误:

/Users/santeri/RubymineProjects/sample_app/script/rails server -b 0.0.0.0 -p 3000 -e     development
/Users/santeri/.rvm/gems/ruby-2.0.0-p0/gems/sqlite3-1.3.7/lib/sqlite3.rb:6:in `require':      dlopen(/Users/santeri/.rvm/gems/ruby-2.0.0-p0/gems/sqlite3-1.3.7/lib/sqlite3/sqlite3_native.bundle, 9): Library not loaded: /usr/local/lib/libsqlite3.0.8.6.dylib (LoadError)
Referenced from: /Users/santeri/.rvm/gems/ruby-2.0.0-p0/gems/sqlite3-1.3.7/lib/sqlite3/sqlite3_native.bundle
    Reason: no suitable image found.  Did find:
        /usr/local/lib/libsqlite3.0.8.6.dylib: mach-o, but wrong architecture
        /usr/local/lib/libsqlite3.0.8.6.dylib: mach-o, but wrong architecture - /Users/santeri/.rvm/gems/ruby-2.0.0-p0/gems/sqlite3-1.3.7/lib/sqlite3/sqlite3_native.bundle

我的 rvm 中只安装了 1 个 ruby​​ 版本:

/Users/santeri/.rvm/rubies/ruby-2.0.0-p0/bin/ruby

运行 'lipo -info /usr/lib/libsqlite3.dylib' 返回:

fat文件中的架构:/usr/lib/libsqlite3.dylib是:x86_64 i386 ppc7400

感谢任何帮助或提示!

【问题讨论】:

    标签: ruby-on-rails sqlite rvm


    【解决方案1】:

    强烈建议您通过Homebrew

    安装SQLite
    1. 通过在终端中运行以下命令并按照提示和说明安装 Homebrew

      ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
      
    2. 运行brew install sqlite

    3. 重启 Rails 服务器

    这应该可以解决您的问题。这将为 Rails 提供一个架构正确的 .dylib 文件以供使用,该文件位于 /usr/local/Cellar/sqlite/3.7.15.1/lib/ 之类的目录中,而不是 /usr/local/bin

    【讨论】:

    • 感谢您的回复!我实际上已经用自制软件安装了 sqlite。它位于您发布的目录中。 /usr/local/Cellar/.../lib/.可能是什么问题?也许我需要符号链接?
    • 运行 brew unlink sqlite && brew link sqlite 将重新链接包。
    • 这样做会导致:This formula is keg-only: so it was not symlinked into /usr/localError: Could not symlink file: /usr/local/Cellar/sqlite/3.7.16.2/bin/sqlite3 Target /usr/local/bin/sqlite3 already exists. You may need to delete it.
    猜你喜欢
    • 1970-01-01
    • 2014-04-29
    • 1970-01-01
    • 2011-08-16
    • 1970-01-01
    • 1970-01-01
    • 2012-02-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多