[英]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.