本人成功在windows上安裝RoR(ruby-1.9.3---rails-4.1.7)
步驟如下:
1. 在http://ruby-lang.org下載ruby-1.9.3安裝版。安裝
2. 在gem資源網站:
下載如下包:(進入上面其中一個網站,搜索,下載即可)
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: rails requires activesupport (= 4.1.7),
actionpack (= 4.1.7), actionview (= 4.1.7), activemodel (= 4.1.7),
activerecord (= 4.1.7), actionmailer (= 4.1.7), railties (= 4.1.7), bundler (< 2.0, >= 1.3.0),
sprockets-rails (~> 2.0)
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: sprockets-rails requires sprockets (< 4.0, >
= 2.8); railties requires thor (< 2.0, >= 0.18.1); actionmailer requires mail (>
= 2.5.4, ~> 2.5); activerecord requires arel (~> 5.0.0); activemodel requires bu
ilder (~> 3.1); actionpack requires rack (~> 1.5.2), rack-test (~> 0.6.2); actio
nview requires builder (~> 3.1), erubis (~> 2.7.0); activesupport requires i18n
(>= 0.6.9, ~> 0.6), json (>= 1.7.7, ~> 1.7), tzinfo (~> 1.1), minitest (~> 5.1),
thread_safe (~> 0.1)
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: sprockets requires hike (~> 1.2), multi_json
(~> 1.0), tilt (!= 1.3.0, ~> 1.1); mail requires mime-types (< 3, >= 1.16)
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: sprockets requires hike (~> 1.2), tilt (!= 1
.3.0, ~> 1.1)
當然還有rails-4.1.7
提供以上所有包的打包附件。大家直接可以下載使用。
3.把他們放在同一個文件夾。 進入命令窗口,cd到這個目錄,
然後執行gem install rails
4. 你會得到下面的錯誤。
就是進入devkit解壓縮目錄,運行ruby dk.rb init
和 ruby dk.rb install 命令即可。
7. 運行命令gem install json --platform=ruby測試是否devkit安裝成功。
8.再次運行gem install rails在上面指定目錄,安裝成功!
如果提示文檔安裝錯誤,可以使用如下命令:
gem install --no-ri --no-rdoc rails