码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu下创建第一个rails应用程序

时间:2017-06-27 21:16:21      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:程序   x86   post   界面   tps   jsb   img   webrick   linux   

  一.创建一个新的应用程序

在控制台输入

> rails new  demo

 create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
...........
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
         run  bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted

 demo文件建好了。


二.怎样启动server

>cd demo 到demo目录下

启动本地web服务器 > rails server

=> Booting WEBrick
=> Rails 4.1.1 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
[2014-06-22 11:11:48] INFO  WEBrick 1.3.1
[2014-06-22 11:11:48] INFO  ruby 2.1.2 (2014-05-08) [x86_64-linux]
[2014-06-22 11:11:48] INFO  WEBrick::HTTPServer#start: pid=5313 port=3000

启动成功

三.通过浏览器訪问server

此时打开浏览器输入URL http://localhost:3000/假设出现下面界面

技术分享

OK,成功。

欲知后事怎样,请听下回讲解。


ubuntu下创建第一个rails应用程序

标签:程序   x86   post   界面   tps   jsb   img   webrick   linux   

原文地址:http://www.cnblogs.com/lxjshuju/p/7087150.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!