Rails3 中script命令的替代

装定了rails+ruby 1.9.2
搞了小程序,发现script命令都变了
官网上是这么说的

script/* replaced by script/rails


另外提示 运行
rails --help
就可以查看多有的选项

选项如下

generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:
 application  Generate the Rails application code
 destroy      Undo code generated with "generate"
 benchmarker  See how fast a piece of code runs
 profiler     Get profile information from a piece of code
 plugin       Install a plugin
 runner       Run a piece of code in the application environment




新建一个rails工程
rails + 工程名 => rails new + 工程名
进入控制台
ruby script/console => rails c 或者 rails console
开启服务
ruby script/server -p *** => rails server -p ***
操作数据库
sudo rails dbconsole 我用的是ubuntu,需要sudo,要不然权限有问题

创建一个model
rails generate model article
删除这个创建的model
rails destroy model article



你可能感兴趣的:(C++,c,ubuntu,Ruby,Rails)