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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值