rake db:create

這是根據config/database.yml內容,直接到資料庫(看你.yml是設定哪種sql)產生database。

但是這樣直接下指令只會對development:之後有反應,如果也想讓test:或是production:的內容產生database,指令範例:

rake db:create RAILS_ENV=production (test自己比照辦理)


==============================

寫RoR的好處是,網路上有許多現成的plugin可以使用,不過要怎麼用呢?

一般而言,建議大家寫RoR搭配git使用(我師父也是這麼教),google之後你會發現很多資源都在github就有

plugin安裝的指令範例:

script/plugin install git://github.com/technoweenie/paperclip.git

切記不要直接下git clone git://github.com/technoweenie/paperclip.git,然後再安裝


==============================

script/destroy可以把script/generate手殘打錯生成的東西清掉。


==============================

有哪些目錄更動後,要重新跑script/server呢?

1. vendor/plugin/

2. lib/(但是裡面的tasks/不用)

3. config

arrow
arrow
    全站熱搜

    笨笨小蟹 發表在 痞客邦 留言(0) 人氣()