SQLite3 停止工作

发布于 2024-10-29 02:42:07 字数 899 浏览 1 评论 0原文

我已经在 ruby​​ 应用程序上工作了一段时间,今天通过“rails 服务器”启动我的服务器,我现在得到了这个:

/Users/Ross/rails_projects/splash/json/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)

在此之前我所做的更改是安装了路边和 json gems。有趣的是,它仍然可以在Heroku上起作用,而不是我当地的机器。因此,它必须是环境的。但是,我无法弄清楚什么破裂和原因。

仍然卡住了,注意到我是否加载了 irb:

    MacBook-Pro:splash Ross$ irb
ruby-1.9.2-p136 :001 > require 'sqlite3'
 => true 
ruby-1.9.2-p136 :002 >

那么为什么它可以工作,而 Rails 服务器却不能呢?我什至尝试重新安装导轨。没有什么。路径问题?

更新:仍然不起作用,尝试了另一种解决方案:从源代码构建、卸载、重新安装、升级rails等。消息略有变化:

/Volumes/Macintosh HD/Users/Ross/rails_projects/splash/json/ruby/1.9.1/gems/sqlite3-1.3.3/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)

我真的需要帮助,这真的会降低我的生产力。

I have been working on an ruby app for a while, and today starting up my server via "rails server" I now get this:

/Users/Ross/rails_projects/splash/json/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)

What I changed before this, was I installed the curb and json gems. The funny thing is it still works on Heroku, just not my local machine. So it must be environmental. However, I cannot figure out what broke and why.

Still stuck, noticed if I load up irb:

    MacBook-Pro:splash Ross$ irb
ruby-1.9.2-p136 :001 > require 'sqlite3'
 => true 
ruby-1.9.2-p136 :002 >

So why does that work and not the rails server? I even tried to reinstall rails. Nothing. Path issue?

Update: Still not working, tried another of solutions: building from source, uninstall, reinstall, upgrade rails, etc. The message has changed slightly:

/Volumes/Macintosh HD/Users/Ross/rails_projects/splash/json/ruby/1.9.1/gems/sqlite3-1.3.3/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)

I really need help, this is really killing my productivity.

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

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

发布评论

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

评论(2

能怎样 2024-11-05 02:42:07

尝试一下,按照 我的博客文章在这里

$ rvm --default 1.9.2

它会输出一条注释,为您提供安装命令以获取最新的 ruby​​。然后重复上面的命令进行设置。您可以通过执行以下操作来测试它,

$ ruby -v

尽管我使用的是 1.8.7,但它应该会向您显示类似于以下内容的内容。

$ ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.2.0]

现在只需重新安装 Rails gem install Rails 并执行 bundle install 即可。通过使用 rvm,并希望使用较新版本的 ruby​​,它将为您设置一个全新的空间来测试新的部署。希望您不会再遇到同样的问题。请随时通知我们:)

Try this, install homebrew and rvm as per my blog post here.

$ rvm --default 1.9.2

It'll spit out a comment giving you the install command to grab the latest ruby. Then repeat the above command to set it. You can test this by doing

$ ruby -v

It should show you something similar to the following, although I'm using 1.8.7

$ ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.2.0]

Now simply reinstall rails gem install rails and do bundle install. By using rvm, and hopefully a newer version of ruby, it'll setup a whole new space for you to test out a new deploy. Hopefully you won't get the same issue again. Keep us posted :)

优雅的叶子 2024-11-05 02:42:07

感谢迈克的回复。有趣的是它不起作用。完成后,我收到一条关于curl丢失的消息。所以我安装了它,立即又弹出sqlite3错误。

经过更多的谷歌搜索,我发现了一篇关于通过 RVM 安装 sqlite3 的帖子。
所以我做了:

rvm gem install sqlite3

然后我做了:

rm -rf .bundle && bundle install

然后它开始工作了。我不确定是删除捆绑包还是通过 rvm 安装,但无论哪种方式它都可以再次工作。

Thanks for the response Mike. Funny thing was it didn't work. After I did it, I got a message about curl was missing. So I installed it and the sqlite3 error popped up immediately again.

A ton more Googling and I found an post about installing sqlite3 through RVM.
so I did a:

rvm gem install sqlite3

then I did:

rm -rf .bundle && bundle install

Then it started working. I'm not sure if it was the deleting the bundle or installing through rvm, but either way it's working again.

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