`
ZoOL
  • 浏览: 30312 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

imatrix Day 1

阅读更多

首先安装rails3, 目前版本是3.0.0.RC

 

gem install rails --pre

 

开始新建

 

首先看一下rails3 的新脚本

 

 

zool@zool-laptop:~/workspace$ rails
Usage:
  rails new APP_PATH [options]

Options:
  -b, [--builder=BUILDER]     # Path to an application builder (can be a filesystem path or URL)
      [--dev]                 # Setup the application with Gemfile pointing to your Rails checkout
      [--edge]                # Setup the application with Gemfile pointing to Rails repository
      [--skip-gemfile]        # Don't create a Gemfile
  -m, [--template=TEMPLATE]   # Path to an application template (can be a filesystem path or URL)
  -d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)
                              # Default: sqlite3
  -O, [--skip-active-record]  # Skip Active Record files
  -J, [--skip-prototype]      # Skip Prototype files
  -T, [--skip-test-unit]      # Skip Test::Unit files
  -r, [--ruby=PATH]           # Path to the Ruby binary of your choice
                              # Default: /home/zool/.rvm/rubies/ruby-1.8.7-p299/bin/ruby
  -G, [--skip-git]            # Skip Git ignores and keeps

Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -s, [--skip]     # Skip files that already exist
  -q, [--quiet]    # Supress status output

Rails options:
  -v, [--version]  # Show Rails version number and quit
  -h, [--help]     # Show this help message and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.

 

开始新建项目

 

 

zool@zool-laptop:~/workspace$ rails new imatrix -d=mysql -J -T
      create  
      create  README
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/helpers/application_helper.rb
      create  app/views/layouts/application.html.erb
      create  app/controllers/application_controller.rb
      create  app/mailers
      create  app/models
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/test.rb
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/inflections.rb
      create  config/initializers/session_store.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  log
      create  log/server.log
      create  log/production.log
      create  log/development.log
      create  log/test.log
      create  public
      create  public/500.html
      create  public/robots.txt
      create  public/index.html
      create  public/favicon.ico
      create  public/422.html
      create  public/404.html
      create  public/images
      create  public/images/rails.png
      create  public/stylesheets
      create  public/stylesheets/.gitkeep
      create  public/javascripts
      create  public/javascripts/.gitkeep
      create  public/javascripts/application.js
      create  script
      create  script/rails
      create  tmp
      create  tmp/sessions
      create  tmp/sockets
      create  tmp/cache
      create  tmp/pids
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
 

 

备忘:  

 

1. rails3 新建项目需要用rails new 来新建

 

2. -d=mysql  指定使用mysql数据, 默认为sqlite3

 

3. -J  跳过建立prototype文件, 现在用JQuery比较多, 之后项目准备用JQ

 

4.-T 跳过建立Test::Unit文件, 之后的测试准备用spec

 

5. rail3默认建立gitignore和gitkeep文件, 可以用 -G 参数跳过

 

 

然后编辑config/database.yml

 

rake db:create

 

rake db:migrate

 

启动服务

 

rails s

 

备忘:

  rails3 中将原来的script/* 都合并为一个脚本 script/rails 

 

因此rails2中的  script/server 就改为了 rails server   ,并且由于提供了short-cut,直接用 rails s就可以启动

 

建立git

 

git init

 

git add .

 

git commit -m 'imatrix init'

 

git remote add origin git@github.com:zhooul/imatrix.git

 

git push origin master

 

备注:

 

github的ssh配置

 

http://help.github.com/linux-key-setup/

 

 

0
0
分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    leetcode中国-day-day-up:记录每天的学习

    day-day-up 记录每天的学习 所有记录暂时移植到readme 从11月开始链接附上 尽量做到详细 9月17日 1 动态规划 0-1背包问题。 2 cnn特征图大小计算。 3 线性回归的描述以及基本假设。 4 leetcode 无重复字符的最长子串...

    python-rong-day05(csdn)————程序.pdf

    res_matrix[i][j] += matrix1[i][k] * matrix2[k][j] ``` 在示例代码中还展示了如何利用`zip`函数计算点与目标点之间的欧氏距离: ```python dis = [sqrt((x - target[0])**2 + (y - target[1])**2) for x, y in ...

    第三届“蓝桥杯”样题(模拟 JAVA 高职)

    System.out.print(matrix[i][j] + " "); } System.out.println(); } } ``` 以上解答覆盖了第三届“蓝桥杯”样题(模拟 JAVA 高职)的所有代码填空题及程序设计题,旨在帮助参赛选手更好地理解题目的要求,并...

    西南交通大学万维c++答案

    day += dayTab[leap][i]; } // 输出结果 cout << "yearDay=" << day ; system("pause"); return 0; } ``` **知识点总结**: 1. **闰年判断**:根据闰年的定义,如果一个年份能被4整除且不能被100整除,则为...

    JAVA程序设计:第5章 数组.ppt

    m[i] = new MyDate(i + 1, i + 1, 1990 + i); m[i].display(); } } } ``` 这里,`m` 是一个`MyDate`对象的引用数组。在循环中,`m[i] = new MyDate(...)` 创建了10个`MyDate`对象,并将其引用存入数组中。数组`...

    Foundamentals of C Programming

    ### C编程基础知识点详解 #### 一、C编程概述与程序开发流程 ##### 1.1 编程介绍 ...int matrix[2][3] = {{1, 2, 3}, {4, 5, 6}}; ``` #### 七、函数 接下来的部分将详细介绍函数的概念和用法。

    for 循环练习题目

    for i in range(1, 10): # 第一位不能为0 for j in range(0, 10): num = int(str(i) * 2 + str(j) * 2) if (int(num ** 0.5)) ** 2 == num: print(num) ``` #### 2. 计算一年中的第几天 - **目标**: 输入某年某...

    Eviews常用命令.pdf

    * 矩阵的定义:Matrix * 对称矩阵的定义:sym * 向量定义:vector * 矩阵的转置:@transpose() * 矩阵逆的运算:@inverse() 命令 * 创建时间序列的工作文件: + a annual:create a 1952 2000 + s semi-annual...

    Basics of Linear Algebra for Machine Learning

    standard Python libraries, and step-by-step tutorial lessons, you will discover what linear algebra is, the importance of linear algebra to machine learning, vector, and matrix operations, matrix ...

    数学资料合集 Math Complete

    Algebra I Basic Notions Of Algebra - Kostrikin A I , Shafarevich I R Algebra Sucsess In 20 Minutes a Day - LearningExpress Algebraic D-modules - A. Borel et. al Algebraic Groups and Discontinuous ...

    C语言二级考试要点汇编

    int matrix[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; ``` **6.3 字符数组** 字符数组用于存储字符串。例如: ```c char str[] = "Hello"; ``` #### 七、函数 **7.1 函数定义** 函数是C语言中的基本模块,...

    Basics of Linear Algebra for Machine Learning (Python)

    You can choose to work through the lessons one per day, one per week, or at your own pace. I think momentum is critically important, and this book is intended to be read and used, not to sit idle. I ...

    Architecting.for.Scale.High.Availability.for.Your.Growing.Applications.epub

    Every day, companies struggle to scale critical applications. As traffic volume and data demands increase, these applications become more complicated and brittle, exposing risks and compromising ...

    C语言讲义V1.2

    1. **System返回值在Windows和Unix下的不同**:在Windows下,`system()` 返回值是命令执行后的返回状态;而在Unix下,返回值是由 `wait()` 函数捕获的子进程终止状态。 2. **POSIX**:POSIX(Portable Operating ...

    海康卫视开发dll文件

    /// 丢弃B帧的个数,取值为0,1,2,0-不丢,1-丢1个B帧,2-丢2个B帧; /// 在多路播放时,将B帧丢弃可以降低CPU的利用率, /// 不过当一路时,最好不丢弃B帧 /// public int throwNum = 1; public int ...

    Programming Collective Intelligence

    Non-negative matrix factorization to find the independent features in a dataset * Evolving intelligence for problem solving -- how a computer develops its skill by improving its own code the more it ...

Global site tag (gtag.js) - Google Analytics