通过gem安装rails
有了gem,安装rails变得异常简单了
输入gem install rails就开始安装,gem会先在本地找安装包,如果没有,就会自动去下载,非常方便
它一个一个会询问你是否安装相关的依赖包,如果不想每次都输入Y来确认,可以通过参数--include-dependencies
来默认安装所有的依赖包
root@xxxx rubywork]# gem install rails --include-dependencies
Attempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
Updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-0.12.1
Successfully installed rake-0.5.4
Successfully installed activesupport-1.0.4
Successfully installed activerecord-1.10.1
Successfully installed actionpack-1.8.1
Successfully installed actionmailer-0.9.1
Successfully installed actionwebservice-0.7.1
Installing RDoc documentation for rake-0.5.4
Installing RDoc documentation for activesupport-1.0.4
Installing RDoc documentation for activerecord-1.10.1
Installing RDoc documentation for actionpack-1.8.1
Installing RDoc documentation for actionmailer-0.9.1
Installing RDoc documentation for actionwebservice-0.7.1
Attempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
Updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-0.12.1
Successfully installed rake-0.5.4
Successfully installed activesupport-1.0.4
Successfully installed activerecord-1.10.1
Successfully installed actionpack-1.8.1
Successfully installed actionmailer-0.9.1
Successfully installed actionwebservice-0.7.1
Installing RDoc documentation for rake-0.5.4

Installing RDoc documentation for activesupport-1.0.4

Installing RDoc documentation for activerecord-1.10.1

Installing RDoc documentation for actionpack-1.8.1

Installing RDoc documentation for actionmailer-0.9.1

Installing RDoc documentation for actionwebservice-0.7.1
安装完成以后可以通过gem list --local
来查看已经安装了哪些包
[root@xxx rubywork]# gem list --local
*** LOCAL GEMS ***
actionmailer (0.9.1)
Service layer for easy email delivery and testing.
actionpack (1.8.1)
Web-flow and rendering framework putting the VC in MVC.
actionwebservice (0.7.1)
Web service support for Action Pack.
activerecord (1.10.1)
Implements the ActiveRecord pattern for ORM.
activesupport (1.0.4)
Support and utility classes used by the Rails framework.
rails (0.12.1)
Web-application framework with template engine, control-flow layer,
and ORM.
rake (0.5.4)
Ruby based make-like utility.
sources (0.0.1)
This package provides download sources for remote gem installation
*** LOCAL GEMS ***
actionmailer (0.9.1)
Service layer for easy email delivery and testing.
actionpack (1.8.1)
Web-flow and rendering framework putting the VC in MVC.
actionwebservice (0.7.1)
Web service support for Action Pack.
activerecord (1.10.1)
Implements the ActiveRecord pattern for ORM.
activesupport (1.0.4)
Support and utility classes used by the Rails framework.
rails (0.12.1)
Web-application framework with template engine, control-flow layer,
and ORM.
rake (0.5.4)
Ruby based make-like utility.
sources (0.0.1)
This package provides download sources for remote gem installation
需要注意的是rubyforge有时候会因为维护暂停服务或者服务不正常,我遇到过有一次死活都安装不了rails
而跑去安装Rails Log Analyzer, 另外一次遇到gem一执行就退出, 从错误上看似乎是远程的服务器有错误
开始我还以为是gem坏了,重新安装了好几次, 结果第二天就自动好了
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架