创建rails工程

[root@localhost work]# rails new demo

      create  

      create  README.rdoc

      create  Rakefile

      create  config.ru

      create  .gitignore

      create  Gemfile

      create  app

      create  app/assets/images/rails.png

......

 

[root@localhost work]# cd demo/

 

[root@localhost demo]# rake db:create RAILS_ENV='development'
Could not find rdoc-3.12.2 in any of the sources
Run `bundle install` to install missing gems.


[root@localhost demo]# bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as
root will break this application for all non-root users on this machine.
Fetching source index from https://ruby.taobao.org/

.......

[root@localhost demo]# bundle update

Fetching source index from https://ruby.taobao.org/

Resolving dependencies...

Using rake 10.4.2

Using i18n 0.6.1

Using multi_json 1.11.0

Using activesupport 3.2.13

Using builder 3.0.4

 

.....

 


[root@localhost demo]# rails g scaffold student name:string age:integer grade:integer 

      invoke  active_record

      create    db/migrate/20150304093405_create_students.rb

      create    app/models/student.rb

      invoke    test_unit

      create      test/unit/student_test.rb

      create      test/fixtures/students.yml

      invoke  resource_route

       route    resources :students

      invoke  scaffold_controller

      create    app/controllers/students_controller.rb

      invoke    erb

........

 

[root@localhost demo]# rake db:migrate RAILS_ENV='development'

==  CreateStudents: migrating =================================================

-- create_table(:students)

   -> 0.0174s

==  CreateStudents: migrated (0.0176s) ========================================

 

[root@localhost demo]# rails s -p80

=> Booting WEBrick

=> Rails 3.2.13 application starting in development on http://0.0.0.0:80

=> Call with -d to detach

=> Ctrl-C to shutdown server

[2015-03-04 17:37:56] INFO  WEBrick 1.3.1

[2015-03-04 17:37:56] INFO  ruby 2.0.0 (2014-11-13) [x86_64-linux]

 

.......

 

[root@localhost demo]# bundle update

Fetching source index from https://ruby.taobao.org/

Resolving dependencies...

Using rake 10.4.2

Using i18n 0.6.1

Using multi_json 1.11.0

Using activesupport 3.2.13

Using builder 3.0.4

 

.....

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值