Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error // Usage: rails new APP_PATH [options] // when running 'rails server'

Background info:

I'm using GIT to get a repository of a project with Ruby files in it. The project lives in my SITES folder under home directory on my Mac.

I have Ruby: 1.8.7

I have just upgraded Rails to: 3.0.3

All I am trying to accomplish is to be able to render localhost.com:3000 in my browser of the GIT project I've already downloaded so I can work on it locally.

I ran the command 'rails server' and was returned the message below::

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-gemfile]        # Don't create a Gemfile
  -m, [--template=TEMPLATE]   # Path to an application template (can be a filesystem path or URL)
  -d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)
                              # Default: sqlite3
  -O, [--skip-active-record]  # Skip Active Record files
  -J, [--skip-prototype]      # Skip Prototype files
  -T, [--skip-test-unit]      # Skip Test::Unit files
      [--dev]                 # Setup the application with Gemfile pointing to your Rails checkout
  -r, [--ruby=PATH]           # Path to the Ruby binary of your choice
                              # Default: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  -G, [--skip-git]            # Skip Git ignores and keeps
  -b, [--builder=BUILDER]     # Path to an application builder (can be a filesystem path or URL)
      [--edge]                # Setup the application with Gemfile pointing to Rails repository

Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -s, [--skip]     # Skip files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -q, [--quiet]    # Supress status output

Rails options:
  -h, [--help]     # Show this help message and quit
  -v, [--version]  # Show Rails version number and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.
like image 666
phillipmaddox Avatar asked Jan 09 '11 02:01

phillipmaddox


2 Answers

You're running rails server from the wrong directory. Go INTO the directory containing your app and run the command from there. For example, if you ran rails new thingy, you must be in the thingy directory when you use rails server.

like image 175
David Sulc Avatar answered Sep 30 '22 14:09

David Sulc


I got this when upgrading from rails 2 to rails 3 also. Then I ran rails new . to replace all the necessary files and it worked after that.

like image 38
Ultimation Avatar answered Sep 30 '22 16:09

Ultimation