开发者

How do I install Rails?

I am completely new to Ruby and need to use Ruby on Rails 2.3.5 on Windows. I have downloaded the zip from GitHub here: https://github.com/rails/rails/tree/v2.3.5

There was no gem file so I tried rake in the extracted directory. It took ages and seemed to have a lot of errors, but it did eventually complete.

There was no gem file created (is this even what rake is supposed to do?). And rails is not installed (typ开发者_如何学编程ing rails at the command prompt doesnt work).

Any ideas what I am doing wrong?

EDIT: I cannot use gem install rails -v "2.3.5" as I am behind a firewall. I think I need to install it from local files.


You first need to download and install Ruby 1.8.7.

You can then install Rails via gem install rails -v=2.3.5


I would recommended you download the gems of Rails 2.3.5 from: http://rubygems.org/gems/rails/versions/2.3.5

You also need other dependencies, such as:

  • actionmailer = 2.3.5
  • actionpack = 2.3.5
  • activerecord = 2.3.5
  • activeresource = 2.3.5
  • activesupport = 2.3.5
  • rake >= 0.8.3

Since you do not have an direct internet connection, you need to download them by hand.

After you download them, use "gem install xxx.gem" to install


install ruby, include gems support. at the command line

gem install rails


Do not install instant rails, as it is outdated and unmaintained. Use RailsInstaller http://railsinstaller.org/


You normally install Rails by only using gem, you only install "by hand" if it is not hosted anywhere.

Do the following steps (I suppose that ruby is installed and the gem command is working):

  1. gem install rails -v 2.3.5

This should include all needed gems as well, and will install the rails command in your shell. However, to use it in Windows is a little bit difficult, because the installation of sqlite3 is not so easy.


If you could access outside world through a corporate proxy, you could use it's address in gem command, like this: gem install rails -v 2.3.5 -p http://corporate_proxy


Install InstantRails: http://broadcast.oreilly.com/2008/12/installing-instant-rails-on-wi.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜