Ang*_*loS 1 ruby sqlite rubygems sinatra bundler
我目前正在尝试运行 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.
Run Code Online (Sandbox Code Playgroud)
但是,运行时ruby app/run.rb
我收到此消息:
Could not find sqlite3-1.4.0 in any of the sources
Run Code Online (Sandbox Code Playgroud)
我已经尝试了几个小时来找出问题所在,我已经卸载并重新安装了 sqlite3,捆绑安装了一百万次,但似乎没有任何效果。任何想法将不胜感激!
对于 Rails 5.2.2,您可以通过在 Gemfile 中指定正确的 sqlite3 版本来解决此问题:
gem 'sqlite3', '~> 1.3.6'
Run Code Online (Sandbox Code Playgroud)
在 Rails 的 5-2-stable 分支中,您可以使用 sqlite 1.4,但在 5.2.2 中它会导致错误。