为什么我的 rails 命令总是创建一个新的应用程序? [英] Why does my rails command always create a new application?
问题描述
请原谅我,因为我是 *nix 和 ruby on rails 的新手.我的 rails 命令总是创建一个新的应用程序,我不知道为什么.运行 "rails new myApp" 只会在当前目录中生成一个名为 "new" 的新 Rails 应用程序.同样,rails server"只是在名为server"的文件夹中创建一个新应用程序.有任何想法吗?我使用的是 Ubuntu 11.04 和 Rails 3.0.9.
Forgive me as I'm new to both *nix and ruby on rails. My rails command always creates a new application and I can't figure out why. Running "rails new myApp" will just generate a new rails application named "new" in the current directory. Likewise "rails server" just creates a new application in a folder named "server". Any ideas? I'm using Ubuntu 11.04 and rails 3.0.9.
推荐答案
当您使用 rails new myApp
创建应用程序时,应该有一个 myApp/script
目录和里面会有一个名为rails
的脚本,这是理解server
和console
的rails
.所以,这样做:
When you create your application with rails new myApp
, there should be a myApp/script
directory and in there will be a script named rails
, this is the rails
that understands server
and console
. So, do this:
$ rails new MyApp
$ cd MyApp
$ script/rails server
创建并启动您的应用程序.命名有点混乱.
To create and start up your application. The naming is a little confusing.
这篇关于为什么我的 rails 命令总是创建一个新的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!