简体   繁体   中英

How can I run Rails “script/[xyz]” commands on Windows?

I am used to doing Rails development work on a Mac. However, now other developers will be working with me and they use Windows, both XP and Vista. I am trying to figure out the Windows environment so I can help them.

In OS X and Linux you have this kind of thing...

$ cd [Rails project root]
$ script/console

Tried it on Windows but all I got was "'script' is not recognized as an internal or external command...etc."

What is the Windows equivalent?

ruby script/whatever

那应该为你做。

Get into your rails directory, then type:

ruby script/(your command)

Make sure that you have the path to ruby on your path - otherwise you need to do:

(path to ruby)/ruby script/(your command)

Does:

c:\railsproject\> ruby script/console

work for you?

Have you tried issuing ruby script\\console ? (Windows uses backslashes as path delimeters instead of foreslashes and doesn't support shebang syntax.)

rails path/to/your/new/application

cd path/to/your/new/application

ruby script/server

Check this out: http://rubyonrails.org/download

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM