Ryan Hayes
Ryan Hayes

Reputation: 5310

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

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?

Upvotes: 0

Views: 6270

Answers (3)

Sam Sheen
Sam Sheen

Reputation: 21

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).

Upvotes: 0

coorasse
coorasse

Reputation: 5528

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

Upvotes: -1

Fabio
Fabio

Reputation: 19176

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.

Upvotes: 4

Related Questions