---
title: "关于在win7上安装Ruby On Rails 环境的几点注意"
author: "amspring"
date: "2013-12-05T18:31:25Z"
tags: ["Rails", "Ruby", "win7"]
categories: ["Web前端"]
slug: "win7-ruby-on-rails"
draft: false
lastmod: "2013-12-05T18:31:25Z"
id: 1985810
url: "https://amspring.iteye.com/blog/1985810"
---

在window下安装Ruby On Rails 环境须知：
1. 需要有Development-Kit，不然会报：unable to convert U+00F4 from UTF-8 to GBK for lib/mail/multibyte/chars.rb，file ‘lib’not found 这些问题
下载地址：https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
安装步骤：
1.Extract Files <DEVKIT_INSTALL_DIR>
2.cd <DEVKIT_INSTALL_DIR>
3.ruby dk.rb init to generate the config.yml
4.edit the generated config.yml（查看是否包含已安装的ruby，没有则手动添加）
5.ruby dk.rb review
6.ruby dk.rb install
7.gem install rdiscount –platform=ruby （这一步是测试是否安装成功）
Temporarily enhancing PATH to include DevKit…

2. 工作目录最好与安装Ruby的目录在同一个盘符里，不然会报 ：
ArgumentError different prefix: “c:/” and “D:/Workspace/cloud-lab/app/assets

3. 需要安装javascript环境，到nodejs官网下载一个安装

4. 如果是有图像的，需要安装ImageMagick环境，mini_magick在window上只支持gem ‘mini_magick’, ’3.5.0′这个版本

5. 安装therubyracer时候，需要制定版本，不然libv8 安装不上： gem ‘therubyracer’, ‘~> 0.11.4′, platforms: :ruby