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.
A Rails application is usually started by running bin/rails console or bin/rails server .
$ rails --help Usage: rails COMMAND [ARGS] The most common rails commands are: generate Generate new code (short-cut alias: "g") console Start the Rails console (short-cut alias: "c") server Start the Rails server (short-cut alias: "s") ... All commands can be run with -h (or --help) for more information.
For creating project in current directory, you can run:
rails new .
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With