惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
美团技术团队
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
A
About on SuperTechFans
Recent Announcements
Recent Announcements
D
Docker
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
腾讯CDC
Martin Fowler
Martin Fowler
阮一峰的网络日志
阮一峰的网络日志

博客园 - 释子

Centos单网卡配置多个IP的方法 归来,冒个泡泡 SGA设置错误导致数据库无法连接问题 盖茨微软亚洲研究院十年创新论坛讲演实录 新产品发布 杂志上看到的老板 “经验汇”团队成立,让我们一起分享经验和快乐 《SOA In the real world》第一章译稿(含下载) 《Service Oreiented Architecture in the Real World》推荐及翻译计划 安装VSTFS后遗症解决方法 小心NLS_SORT和NLS_COMP的设置成为性能杀手 Microsoft Visual Studio International Pack 1.0 过度配置与过度设计一样可怕 解除SourceSafe锁定的小技巧 比尔盖茨退休告别演说:下个数字十年 始信 体验了一下用word 2007发表博客 细说Oracle Session 编程活动中几个不良现象
windows下ruby安装环境配置
释子 · 2015-01-30 · via 博客园 - 释子

Ruby 安装

从源代码在windows下安装Ruby是非常苦逼的差事,可以从http://rubyinstaller.org/

或者 http://railsinstaller.org/ 下载已经打包好的安装程序。

Ruby配置

  1. 在windows中配置环境变量
  • RUBY_HOME=rubyinstaller_dir (实际的ruby所在路径)

  • 在path中添加 %RUBY_HOME%\bin

  1. 在命令行下运行 ruby --version,如果显示ruby版本信息说明安装正常。

devkit安装

  1. 下载devkit

如果使用rubyinstaller安装包需单独下载devkit,下载路径为 DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe 。该文件是7zip压缩包。

  1. 解压缩下载的文件到合适的路径,如F:\Software\develop\DevKit-mingw64-64-4.7.2-20130224-1432-sfx

  2. 命令行下进入devkit目录,运行 ruby dk.rb init, 运行完后会生成一个 config.yml文件

  3. 打开config.yml文件,加入ruby所在路径,如

# This configuration file contains the absolute path locations of all

# installed Rubies to be enhanced to work with the DevKit. This config

# file is generated by the 'ruby dk.rb init' step and may be modified

# before running the 'ruby dk.rb install' step. To include any installed

# Rubies that were not automagically discovered, simply add a line below

# the triple hyphens with the absolute path to the Ruby root directory.

#

# Example:

#

# ---

# - C:/ruby19trunk

# - C:/ruby192dev

#

---

- E:\Ruby21-x64

注意保持上面的格式。

5. 命令行下进入devkit目录,运行 ruby dk.rb install

至此ruby运行环境配置好了。在命令行下面可以像在linux下一样安装bundle和其他gem。

rmagick安装问题

在安装rmagick的时候会提示“无效的格式”等等错误,这是因为缺少ImageMagick的原因。可以用以下方式解决:

  1. 下载ImageMagick的windows安装包

ImageMagick windows安装包

  1. 安装ImageMagick

注意两个安装选择项一定要勾上,并且安装路径不要有空格,如program files (微软这个默认路径害死多少人?):

  • Add application direcotry to your system path

  • Install development headers and libraries for C and C++

  1. 命令行下运行 gem install rmagick --platform=ruby -- --with-opt-dir= ImageMagick_dir (换成自己的目录)