[英]Error while starting server in ruby on rails
我是Ruby on Rails的新手,在這里,我嘗試在64位Windows 7的Rails上安裝Ruby。
在運行命令rails new app_name
,我先執行了cd app_name
,然后安裝了rails server
隨后在命令提示符下出現以下錯誤。
我該如何解決這個錯誤?
Could not find gem 'mysql2 (>= 0) x64-mingw32' in any of the gem sources listed
in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
如果我運行捆綁安裝,我會得到
C:\Users\walnut>bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.................
Using rake 10.4.2
Using i18n 0.7.0
Installing json 1.8.3 with native extensions
Gem::InstallError: The 'json' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
在這里您可以嘗試以下解決方案:
For use with Ruby 1.8.7 and 1.9.3:
在我們安裝ruby-1.9.3時,這些下載頁面中的文本。
ruby dk.rb init
和ruby dk.rb
install將其綁定到路徑中的ruby安裝。 gem install rails --no-ri --no-rdoc
rails new yourProject
"An error occurred while installing rake (*any version), and Bundler cannot continue."
,請參考此解決方案或執行以下步驟:
C:\\Ruby193\\lib\\ruby\\site_ruby\\1.9.1\\rubygems\\ssl_certs
。 rails new yourProject
(上一個失敗)。 yourProject
目錄,然后運行rails server
。 我在Windows平台上首次安裝時也遇到困難,希望能有所幫助。 請注意,如果您使用的不是默認數據庫,而是通過Rails(sqlite3)使用mysql, postgresql, etc
,則需要安裝正確的gem才能正常工作。 只需運行gem install theRightGemForDatabase
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.