“无法在另一个目录中初始化新的 Rails 应用程序,请键入‘rails’寻求帮助." [英] "Can't initialize a new Rails application within the directory of another, please Type 'rails' for help."

查看:13
本文介绍了“无法在另一个目录中初始化新的 Rails 应用程序,请键入‘rails’寻求帮助."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 rails,我正在练习基本的 ruby​​ 命令,其中之一是 rails new myproject 命令.

I'm just starting out with rails and I'm practicing the basic ruby commands, one of which is the rails new myproject command.

我的项目位于 Aptana 工作区目录下,我使用命令行和 Aptana 在那里创建项目.经过几次创建和 rails s 命令和删除后,当我尝试生成新的 rails 项目时,我开始收到此错误消息:

My projects are under the Aptana workspace directory where I've used the command line and Aptana both to create projects there. After a few creations and rails s commands and deletions, I've started getting this error message when I try to generate a new rails project:

"无法在以下目录中初始化新的 Rails 应用程序另一个,请输入‘rails’寻求帮助."

"Can't initialize a new Rails application within the directory of another, please Type 'rails' for help."

这不仅在我在 Aptana 工作区目录下创建新项目 (rails new myproject) 时发生,而且在我使用命令 rails new . 时也会发生直接在工作区目录中.有人可以向我解释我需要做什么来冲洗导轨,以便它知道我不再有项目了吗?我做了什么让这一切发生?

This doesn't just happen when I create a new project (rails new myproject) under the Aptana workspace directory, but also when I use the command rails new . directly inside the workspace directory. Can someone explain to me what I need to do to flush rails so it knows I don't have a project there anymore? What did I do to make this happen?

推荐答案

我不记得 Rails 在寻找什么.解决此问题的最快方法是完全清空受影响的目录.

I don't remember what rails looking for. The quickest way to solve this issue is to completely empty the affected directory.

很可能有一些隐藏文件或目录会阻止 rails 创建新项目.用 ls -a 看看那个目录中可能有一个 .bundle 文件夹.

Most likely there are some hidden files or directories which prevents rails from creating a new project. Look at that with ls -a probably there is a .bundle folder inside that dir.

这篇关于“无法在另一个目录中初始化新的 Rails 应用程序,请键入‘rails’寻求帮助."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆