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 gen
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.
For creating project in current directory, you can run:
rails new .
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
.
Rails 2.3.5
rails new # will create a project new
rails new myapp # still will create a project new
rails server # will create a project server
to run the server :
cd script
( a directory in your project folder ) and then run ./server
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
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.