开发者

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: mys开发者_Go百科ql/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.


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.


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.


Other issue could be:

You must have deleted bin folder from root directory or some files in it. please recover it back and all will work normally.


Your folder director should be in Gemfile,

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


Usually if you clone a repository or if you are using Docker, files like .gitignore or .dockerignore has instructions for doesn't include bin folder, check in both files and simply remove the line with it.

You can execute rails new in another directory and copy the generated bin folder to your project and then push to your repository.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜