rails2之前创建新项目:
rails3以及更高版本创建新项目:rails new webname
创建数据表model:rails g model user name:string sex:string
创建controller:rails g controller user index new create edit update delete
添加字段到user表:rails g migration add_name_and_sex_to_user name:string sex:string
服务器后端运行rails项目开发环境:rails s -p 1026 -b 192.55.34.43 -d
服务器后端运行rails项目生产环境:rails s -e production -p 8080 -b 192.55.34.43 -d
服务器后台直接运行方法(不用rails c):nohup rails r "LibraryBook.create_index_load_basedata" &
开发环境下运行rails c:rails c e production