Ruby on rails 如何安装RubyonRails

Ruby on rails 如何安装RubyonRails,ruby-on-rails,ruby,Ruby On Rails,Ruby,我是RubyonRails的新手,这里我尝试在Windows7 64位上安装RubyonRails。我安装了ruby安装程序和rails。我还创建了新的应用程序文件。但是当我启动rails服务器时,它显示了以下错误 如何摆脱这些错误并开始开发ruby应用程序 C:\Users\walnut\Desktop > bundle install Fetching gem metadata from https://rubygems.org/............ Fetching versio

我是RubyonRails的新手,这里我尝试在Windows7 64位上安装RubyonRails。我安装了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.

您是在哪里创建应用程序的?如果您查看命令行,您就在桌面上。您需要将目录切换到项目文件夹才能处于正确的上下文中

此外,您需要安装构建工具来安装json本机扩展


请参考/遵循另一个堆栈溢出答案中的说明-。

您是在哪里创建应用程序的?如果您查看命令行,您就在桌面上。您需要将目录切换到项目文件夹才能处于正确的上下文中

此外,您需要安装构建工具来安装json本机扩展


请参考/遵循另一个堆栈溢出答案-。

中的说明,因为错误建议您必须更新路径,以包括构建工具(也称为
DevKit

如果您已经使用RailsInstaller在您的计算机上安装了ruby on rails,那么它已经包含在您的rails安装目录中。您现在所要做的就是更新您的路径以包含它。请参阅中说明的步骤4


如果没有,请按照上述说明安装
DevKit
,然后开始工作。

因为错误提示您必须更新路径,以包括生成工具(也称为
DevKit

如果您已经使用RailsInstaller在您的计算机上安装了ruby on rails,那么它已经包含在您的rails安装目录中。您现在所要做的就是更新您的路径以包含它。请参阅中说明的步骤4

如果没有按照上面的说明安装DevKit,那么就开始工作。

试着按照下面的说明操作,如果您使用ruby installer的x64,那么请使用x64 DevKit。这同样适用于x86。我正面临这个问题,链接给了你(安装步骤),节省了我的时间。希望这有帮助

p/s:如果我在windows中是正确的,上面的ruby v2.2不支持更高版本的nokogiri,要使事情正常运行,请使用ruby v1.9.3或v2.1.6

检查此项是否支持nokogiri。

尝试遵循此项和另外一件事,如果您使用ruby installer的x64,请使用x64 devkit。这同样适用于x86。我正面临这个问题,链接给了你(安装步骤),节省了我的时间。希望这有帮助

p/s:如果我在windows中是正确的,上面的ruby v2.2不支持更高版本的nokogiri,要使事情正常运行,请使用ruby v1.9.3或v2.1.6

也检查支持的nokogiri。

遵循以下步骤:

  • 从下载DevKit文件
  • 将DevKit提取到路径C:\RubyXXX\DevKit
  • 运行
    cd C:\RubyXXX\DevKit
  • 运行
    ruby dk.rb init
  • 运行
    ruby dk.rb review
  • 运行
    ruby dk.rb安装
  • ,

    遵循以下步骤:

  • 从下载DevKit文件
  • 将DevKit提取到路径C:\RubyXXX\DevKit
  • 运行
    cd C:\RubyXXX\DevKit
  • 运行
    ruby dk.rb init
  • 运行
    ruby dk.rb review
  • 运行
    ruby dk.rb安装

  • 试着按照这个步骤试着按照这个步骤完美的回答!谢谢你完美的回答!谢谢