[英]gem install and bundle install fails to install sqlite3
我是 Rails 的新手,我正在從 Ruby on Rails 教程中學習它。 當我在 Gemfile 中使用gem 'sqlite3'
時, bundle install
命令顯示此錯誤;
An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
sqlite3
我在這里找到了解決方案 - https://medium.com/@declancronje/installing-and-troubleshooting-ruby-on-rails-sqlite3-windows-10-fix-87c8886d03b ,建議gem 'sqlite3'
應該替換為gem 'sqlite3', git: “https://github.com/larskanis/sqlite3-ruby", branch: “add-gemspec”
。在更新 Gemfile 后運行bundle install
時,所有必需的 gem,包括 sqlite3,似乎已經安裝;
Bundle complete! 15 Gemfile dependencies, 70 gems now installed.
Use 'bundle info [gemname]' to see where a bundled gem is installed.
但是在運行命令sqlite3 --version
時,我仍然收到錯誤消息
'sqlite3' is not recognized as an internal or external command,
operable program or batch file.
我還提到了各種 stackoverflow 答案,但它們似乎都不起作用。 gem install sqlite3
也不起作用。 請幫忙。
試試看有幫助
sudo apt-get 安裝 libsqlite3-dev
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.