首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

搭建ruby on rails出现Gem:DependencyError的解决办法

2013-01-25 
搭建ruby on rails出现Gem::DependencyError的解决方法今天按照网上的教程打算在xp下搭建一个ruby on rail

搭建ruby on rails出现Gem::DependencyError的解决方法

今天按照网上的教程打算在xp下搭建一个ruby on rails的开发环境结果出现了一个错误,网上搜了一遍问题解决了。下面总结一下解决方法备忘。

错误提示出现在自动安装gem的过程中。

——————————————我是分割线——————————————

D:/ruby187/gem install rails --include-dependencies

ERROR:? While executing gem ... (Gem::DependencyError)
??? Unable to resolve dependencies: rails requires activesupport (= 3.2.3)... ? --此处省略若干字错误信息

——————————————我是分割线——————————————

解决步骤:

1、gem update --system #先在线更新rubygem

2、依次执行下面命令:

?

[ruby]?view plaincopy
  1. gem?install?rake??
  2. gem?install?-v=1.0.1?rack??
  3. gem?install?rails?--include-dependencies???

?

如果不出意外,此时rubyonrals的开发环境已经搭建成功。

如果此时又会出现一个新的错误,请接着往下看。

——————————————我是分割线——————————————

ERROR:? Error installing rails:
??????? 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'

——————————————我是分割线——————————————

这次提示要安装devkit(顺带吐槽一下:错误提示中提供了下载链接不能用,应该是被q1ang了)。下载下来的文件是一个压缩文件。双击解压到任意目录。依次执行下面命令

?

[ruby]?view plaincopy
  1. cd?<devkit安装目录>?#进入到devkit安装(解压)目录??
  2. <code>ruby?dk.rb?init</code>?#会在devkit安装目录下生成一个<code>config.yml</code>,这个文件包含了已经安装的ruby??
  3. <code>ruby?dk.rb?install</code>?#安装devkit??
  4. <pre?name="code"?class="ruby">gem?install?rails?--include-dependencies???
  5. Fetching:?i18n-0.6.0.gem?(100%)??
  6. Fetching:?multi_json-1.3.5.gem?(100%)??
  7. Fetching:?activesupport-3.2.3.gem?(100%)??
  8. </pre>??
  9. <pre></pre>??
  10. <p></p>??
  11. <pre></pre>??
  12. 终于出现的我们所期望的进度表了。大功告成。赶快开始你的rails的hello?world吧。??
  13. <p></p> ?

热点排行