【发布时间】:2019-07-03 19:54:04
【问题描述】:
我目前正在尝试运行 run.rb 文件,但我不断收到 sqlite3 错误。当我输入 bundle install 时,我会收到以下成功消息:
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.4
Using i18n 1.5.3
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using activemodel 5.2.2
Using arel 9.0.0
Using activerecord 5.2.2
Using bundler 2.0.1
Using coderay 1.1.2
Using equatable 0.5.0
Using method_source 0.9.2
Using mustermann 1.0.3
Using necromancer 0.4.0
Using tty-color 0.4.3
Using pastel 0.7.2
Using pry 0.12.2
Using rack 2.0.6
Using rack-protection 2.0.5
Using require_all 2.0.0
Using tilt 2.0.9
Using sinatra 2.0.5
Using sinatra-activerecord 2.0.13
Using sqlite3 1.4.0
Using timers 4.3.0
Using tty-cursor 0.6.0
Using tty-screen 0.6.5
Using wisper 2.0.0
Using tty-reader 0.5.0
Using tty-prompt 0.18.1
Bundle complete! 7 Gemfile dependencies, 32 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
但是,在运行 ruby app/run.rb 时,我收到以下消息:
Could not find sqlite3-1.4.0 in any of the sources
我已经尝试了几个小时来找出问题所在,我已经卸载并重新安装了 sqlite3,捆绑安装了一百万次,但似乎没有任何效果。任何想法将不胜感激!
【问题讨论】:
-
您是否有任何理由不使用
rails server来启动服务器,甚至不使用bundle exec rails server来确保在启动服务器时加载捆绑包?为什么要使用ruby app/run.rb启动它? -
1.4.0 是 5 天前发布的新版本。您是否尝试过使用早期版本?
-
我尝试过需要早期版本,但我收到相同的 sqlite3 not found 消息:
Could not find sqlite3-1.3.13 in any of the sources -
@ulferts 我目前正在使用 Sinatra
-
那么,您尝试运行
bundle exec ruby run/app.rb了吗?我假设 gems 安装得很好,但在运行时require不可用。 bundle exec 应该可以解决这个问题。
标签: ruby sqlite rubygems sinatra bundler