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

早过忘川 提交于 2020-01-07 06:20:00

问题


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

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:

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

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?


回答1:


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

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.




回答2:


I got same problem since I failed to create rails project. I tried to remove Aptana plug-in and Eclipe that include ./eclipse, ./metadata but not sloved the problem until I removed Ruby and Devkit and reinstall them again.

So, I think the root cause may in Devkit or Ruby. The problem work out after I reinstall Ruby(rubyinstaller-2.2.3-x64.exe) and DevKit(DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe).




回答3:


If you are under Windows, you must install Aptana Studio as administrator or it will not work properly. Uninstall and install it as administrator and the terminal folder will be set correctly



来源:https://stackoverflow.com/questions/7176187/cant-initialize-a-new-rails-application-within-the-directory-of-another-pleas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!