gpt4 book ai didi

ruby-on-rails - 如何在 rails 上安装 ruby

转载 作者:太空宇宙 更新时间:2023-11-03 17:14:55 24 4
gpt4 key购买 nike

我是 ruby​​ on rails 的新手,在这里我试图在 windows 7 64 位上安装 ruby​​ on rails。我安装了 ruby​​ 安装程序并安装了 rails。我还创建了新的应用程序文件。但是当我启动 Rails 服务器时,它显示以下错误。

我怎样才能摆脱这些错误并开始开发我的 ruby​​ 应用程序?

C:\Users\walnut\Desktop > 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.

C:\Users\walnut\Desktop > rails s
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\Desktop > gem install mysql2
Fetching: mysql2-0.3.19.gem (100%)
ERROR: Error installing mysql2:
The 'mysql2' 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'

C:\Users\walnut\Desktop > rails s
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.

最佳答案

From here ,

关注Instructions from the Ruby Installer Developer Kit Wiki :

  1. rubyinstaller.org 下载 DevKit 文件
  2. 将 DevKit 解压到路径 C:\RubyXXX\DevKit
  3. 运行 cd C:\RubyXXX\DevKit
  4. 运行 ruby dk.rb init
  5. 运行ruby dk.rb review
  6. 运行 ruby dk.rb install

关于ruby-on-rails - 如何在 rails 上安装 ruby ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31780185/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com