怎么樣?我嘗試使用 Ruby on Rails 創建我的第一個應用程式,我可以創建專案,但無法運行服務器。我的作業系統是 Windows。我安裝了 Node、Yarn、Ruby、Rails、Sqlite3。當我嘗試運行“rails s”時出現此訊息
Could not find gem 'sqlite3' in locally installed gems.
Run `bundle install` to install missing gems.
我運行命令“捆綁安裝”、“捆綁更新”并且不起作用。當我運行“捆綁安裝”時會出現此訊息:
An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
In Gemfile:
sqlite3
當我驗證 sqlite3: enter image description here的版本時, 我嘗試編輯 Gemfile:
gem 'sqlite3', '~> 1.4.2'
并嘗試以這種方式安裝:
gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'
我也試過這個步驟:https : //www.youtube.com/watch?v=cAseoJeNG8I
我遵循 Windows 用戶檔案中的建議并在 Bash 上運行“bin/rails s”,但仍然存在同樣的問題。我在這里閱讀了類似問題的其他答案,但沒有幫助我,為此我提出了這個問題。如果您有什么想念的問題,請告訴我,我會提供資訊。感謝大家。
uj5u.com熱心網友回復:
發生上述錯誤是因為sqlite3您的系統上未安裝。
步驟 1:-首先,sqlite3按照此處提到的步驟在您的系統上安裝
步驟 2:-運行bundle install
uj5u.com熱心網友回復:
你試過洗掉gemfile.lock嗎?嘗試洗掉,然后再次輸入bundle install
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/391726.html
