rails学习
2017-07-06 本文已影响0人
小潘不怕冷
使用 $gem install rails 安装rails (具体前置配置看ruby配置环境)
rails安装完毕使用 $rails -v 查看rails版本
创建一个新的rails项目
$ cd 文件需要存储的位置
$ Rails new 项目名称 --skip-bundle (--skip-bundle 命令是省略bundle安装先)
创建成功后进入文件夹查看

进入Gemfile查看
- Gemfile为安装gem的配置
- 可配置gem的版本
- 具体版本含义

修改gem源
source 'https://gems.ruby-china.org'

开启rails工程
$ Rails server
可以使用http://localhost:3000 访问工程

关闭server
Use Ctrl-C to stop