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.
6 Answers
You have installed rails through apt-get so you have rails 2. If you want rails 3, use
sudo apt-get remove --purge rails # very important so that the new rails is called
sudo apt-get install rubygems
sudo gem install rails
Don't forget to relaunch your terminal and you're done.

- 958
- 1
- 8
- 10
-
thanks, I'm new to using RoR in linux, so the step-by-step definitely helped! – dodgrile Mar 03 '13 at 22:30
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.

- 426,620
- 70
- 833
- 800
-
@user359796: And if you use Rails 2, there will be several scripts (`server`, `console`, ...) in the `scripts/` directory instead of just `rails`. – mu is too short Jun 19 '11 at 06:53
-
2This doesn't add up. If `rails new myApp` created a new Rails application named `new`, then the OP is on Rails 2, *not* Rails 3. – David Jun 19 '11 at 18:28
-
1@David: Sounds to me like he has PATH confusion on top of everything else but maybe he figured out that part on his own. That's why I added the comment about Rails 2. Your point is a good one though. – mu is too short Jun 19 '11 at 18:40
-
This was very common for rails 3 users following rails 2 instructions. Getting a new app called 'new' is exactly the result of the mix-up due to the syntax change. – Michael Durrant Apr 15 '13 at 01:02
That sounds like the behavior of Rails 2, not Rails 3. With Rails 2, typing rails appname
would create a new Rails application named appname
. With Rails 3, the syntax is now rails new appname
. You should double-check that you're using the version of Rails that you think you are. To do that, type rails --version
.

- 2,311
- 1
- 15
- 13
The common way to create a Rails application is:
rails new MyApp
This will create a folder with your new Rails application called MyApp
If your folder name is the same name you plan to use for your application you can use the command below:
rails new .
Notice the period at the end telling it to use the current directory.
If you want to supply a specific application name, you’ll have to do the following:
rails new /path/to/folder/you/want/to/use

- 2,202
- 1
- 23
- 30