论坛首页 入门讨论版

Rails安装

浏览 3414 次
锁定老贴子 主题:Rails安装
该帖已经被评为新手帖
作者 正文
最后更新时间:2006-12-03 关键字: rails 问题 错误 失败 ruby gem 如何安装

1、首先看一Ruby是否安装,如果没有请看这里,然后再看看RubyGems是否被安装。
使用命令下运行 gem --version
  

  1. C:\Documents and Settings\Administrator>gem --version   
  2. 0.9.0  

会显示出gem版本,上面是0.90的。

如果RubyGems没有安装。
从以下网址下载安装RubyGems
http://www.rubyonrails.org/down

如:rubygems-0.9.0.zip
解压后,在命令行下运行 ruby setup.rb 安装

2、Rails安装,在命令行下运行
gem install rails --include-dependencies
等待一些时间,gem会自动通过网络安装Rails。
会显示如下提示信息,安装完成后。

  1. Successfully installed rails-1.1.6  

有时网络比较忙可能会出现超时现象,导致安装失败,可以重试安装几次就没问题了。


还有几个命令可以试一下,都可以安装Rails的。
gem install rails --remote
gem install rails

安装完成后可以看看gem都安装了哪里包:gem list --local
*** LOCAL GEMS ***
actionmailer (1.2.5)
    Service layer for easy email delivery and testing.
actionpack (1.12.5)
    Web-flow and rendering framework putting the VC in MVC.
actionwebservice (1.1.6)
.......省略。。


3、rials都安装了些什么?
类似如下路径看到些东西。都是rails的包文件,与ruby安装在同一目录下。
C:\ruby\lib\ruby\gems\1.8\gems

并在C:\ruby\bin下加入了rails.cmd文件。

 

 

   
最后更新时间:2006-12-05
今天用gem install rails命令安装rails出现了一个错误,不知如何解决。
D:\>gem install rails
Bulk updating Gem source index for: http://gems.rubyforge.org
Install required dependency activesupport? [Yn]  y
Install required dependency activerecord? [Yn]  y
Install required dependency actionpack? [Yn]  y
Install required dependency actionmailer? [Yn]  y
Install required dependency actionwebservice? [Yn]  y
Successfully installed rails-1.1.6
Successfully installed activesupport-1.3.1
Successfully installed activerecord-1.14.4
Successfully installed actionpack-1.12.5
Successfully installed actionmailer-1.2.5
Successfully installed actionwebservice-1.1.6
Installing ri documentation for activesupport-1.3.1...
While generating documentation for activesupport-1.3.1
... MESSAGE:   Unhandled special: Special: type=17, text="<!-- HI -->"
... RDOC args: --ri --op d:/ruby/lib/ruby/gems/1.8/doc/activesupport-1.3.1/ri --
quiet lib
(continuing with the rest of the installation)
Installing ri documentation for activerecord-1.14.4...
Installing ri documentation for actionpack-1.12.5...
While generating documentation for actionpack-1.12.5
... MESSAGE:   Unhandled special: Special: type=17, text="<!-- The header part o
f this layout -->"
... RDOC args: --ri --op d:/ruby/lib/ruby/gems/1.8/doc/actionpack-1.12.5/ri --qu
iet lib
(continuing with the rest of the installation)
Installing ri documentation for actionmailer-1.2.5...
Installing ri documentation for actionwebservice-1.1.6...
Installing RDoc documentation for activesupport-1.3.1...
Installing RDoc documentation for activerecord-1.14.4...
Installing RDoc documentation for actionpack-1.12.5...
Installing RDoc documentation for actionmailer-1.2.5...
Installing RDoc documentation for actionwebservice-1.1.6...

D:\>

谢谢。我的ruby安装在D盘,而且安装成功。操作系统是windows
   
0 请登录后投票
最后更新时间:2006-12-05
使用以下命令再试试。
gem install rails --include-dependencies
gem install rails --remote
gem install rails

大部分问题都是网络问题,如网络比较忙等,重试几次会好的。
   
0 请登录后投票
最后更新时间:2006-12-06
我用 rails -v看 显示 Rails 1.1.6 说明已经安装好了吧?

做了一个例子,也能正常运行。
   
0 请登录后投票
最后更新时间:2006-12-06
恭喜你,已经安装好啊。哈哈。
   
0 请登录后投票
最后更新时间:2007-08-22
你可以用 "gem update rails" 对你的rails进行更新!
   
0 请登录后投票
论坛首页 入门讨论版

跳转论坛:
JavaEye推荐