SQLite3 停止工作
我已经在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试一下,按照 我的博客文章在这里。
它会输出一条注释,为您提供安装命令以获取最新的 ruby。然后重复上面的命令进行设置。您可以通过执行以下操作来测试它,
尽管我使用的是 1.8.7,但它应该会向您显示类似于以下内容的内容。
现在只需重新安装 Rails
gem install Rails
并执行bundle install
即可。通过使用 rvm,并希望使用较新版本的 ruby,它将为您设置一个全新的空间来测试新的部署。希望您不会再遇到同样的问题。请随时通知我们:)Try this, install homebrew and rvm as per my blog post here.
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
It should show you something similar to the following, although I'm using 1.8.7
Now simply reinstall rails
gem install rails
and dobundle 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 :)感谢迈克的回复。有趣的是它不起作用。完成后,我收到一条关于curl丢失的消息。所以我安装了它,立即又弹出sqlite3错误。
经过更多的谷歌搜索,我发现了一篇关于通过 RVM 安装 sqlite3 的帖子。
所以我做了:
然后我做了:
然后它开始工作了。我不确定是删除捆绑包还是通过 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:
then I did:
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.