- 博客(0)
- 资源 (4)
- 收藏
- 关注
ruby创建blog
1.rails new blog --skip-bundle //创建项目
2.cd blog //进入项目根目录
3.subl . //打开项目开发环境
4.Bundle install //安装gem包环境
5.rails generate model post title:string content:text author:string published_at:datetime
6.rake db:migrate //数据迁移
7.Rails console //控制台
2.4.1 :004 > Post
=> Post (call 'Post.connection' to establish a connection)
2.4.1 :005 > Post.all
Post Load (2.2ms) SELECT "posts".* FROM "posts" LIMIT ? [["LIMIT", 11]]
=> #<ActiveRecord::Relation []>
2.4.1 :006 > Post
2018-05-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人