windows怎么安装ruby

Python088

windows怎么安装ruby,第1张

方法/步骤如下:

1、直接去ruby的官网上下载rubyinstall的安装包

2、下载完成

3、先安装ruby吧

点击安装,额,咳咳什么情况,好了 人是有国籍的,但知识无国界的

是这个意思吧,选择安装语言

4、选择安装目录

顺便勾选上添加到环境变量吧

5、安装完成

打开命令行,ruby -v查看下吧,安装成功

6、安装devkit

这货是个压缩包,直接解压到指定的文件夹就好了

7、创建 config.yml 文件

打开命令行,进入devkit的解压目录

ruby dk.rb init 初始化创建config.yml文件

8、查看config.yml

文件最后是否自动加上- C:/Ruby22,如果没有手动加上就可以了

9、回到命令行

执行审查和安装吧

ruby dk.rb reviewruby dk.rb install即可

下载并安装Ruby Installer for Windows.安装程序已经包含了RubyGems。请确保当你安装和使用vmc时候使用带Ruby功能的命令提示符窗口,从Windows的“开始”菜单中的“所有程序”→“Ruby<VERSION>→启动命令提示符使用Ruby"。

最后,从Ruby命令提示符更新RubyGems

prompt>gem update --system

Windows Gemfiles支持

一旦你安装了Ruby,你可以按照说明来部署app和使用Gemfile,部署Ruby应用到Cloud Foundry

Windows用户要注意以下几点:

当Windows机器上生成Gemfile.lock文件,它往往包含与Windows匹配特定版本的gems,例如mysql2,thin,PG含有“-X86-mingw32的”的后缀。

例如,在Windows机器上运行包安装用的Gemfile,看起来像这样:

先安装rubyinstaller,下载并解压DevKit,注意,这两个版本要对应,网页上有说明(http://rubyinstaller.org/downloads/),解压DevKit后,打开目录,运行devkitvars.bat(是不是必须的不确定)。

打开cmd,进入DevKit的解压目录

ruby dk.rb

---

Configures an MSYS/MinGW based Development Kit (DevKit) for

each of the Ruby installations on your Windows system. The

DevKit enables you to build many of the available native

RubyGems that don't yet have a binary gem.

Usage: ruby dk.rb COMMAND [options]

where COMMAND is one of:

init prepare DevKit for installation

review review DevKit install plan

install install required DevKit executables

and 'install' [options] are:

-f, --force overwrite existing helper scripts

-------------

ruby dk.rb init

---

Initialization complete! Please review and modify the auto-generated

'config.yml' file to ensure it contains the root directories to all

of the installed Rubies you want enhanced by the DevKit.

--------------------------------

ruby dk.rb install

---

Invalid configuration or no Rubies listed. Please fix 'config.yml'

and rerun 'ruby dk.rb install'

如果出现的是这个,则需要修改config.yml

加入

- C:\Ruby200-x64

---

[INFO] Updating convenience notice gem override for 'C:/Ruby200-x64'

[INFO] Installing 'C:/Ruby200-x64/lib/ruby/site_ruby/devkit.rb'

这是对的

---------------------

gem install ruby-debug-ide

---

Temporarily enhancing PATH to include DevKit...

Building native extensions. This could take a while...

Successfully installed ruby-debug-ide-0.4.17

Parsing documentation for ruby-debug-ide-0.4.17

Installing ri documentation for ruby-debug-ide-0.4.17

1 gem installed