Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem running "rails s"

I have a problem running rails s in Ubuntu. When I type rails s it doesn't start the server, but instead it outputs:

kyala@ubuntu:~/depot$ rails s

Usage:
  rails new APP_PATH [options]

Options:
  
-r, [--ruby=PATH]           # Path to the Ruby binary of your choice
                              # Default: /home/kyala/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
  
-d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)enter code here
                              # Default: sqlite3
 
 -b, [--builder=BUILDER]     # Path to an application builder (can be a filesystem path or URL)
  
-m, [--template=TEMPLATE]   # Path to an application template (can be a filesystem path or URL)
      [--dev]                 # Setup the application with Gemfile pointing to your Rails 

checkout
      [--edge]                # Setup the application with Gemfile pointing to Rails 

repository
      
[--skip-gemfile]        # Don't create a Gemfile
 
 -O, [--skip-active-record]  # Skip Active Record files
 
 -T, [--skip-test-unit]      # Skip Test::Unit files
 
 -J, [--skip-prototype]      # Skip Prototype files
 
 -G, [--skip-git]            # Skip Git ignores and keeps


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


Rails options:
 
 -v, [--version]  # Show Rails version number and quit

  -h, [--help]     # Show this help message 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 939
kYaLa OplAdO Avatar asked Sep 25 '11 16:09

kYaLa OplAdO


3 Answers

Try to regenerate binstubs:

rm bin/*
rake rails:update:bin

It should do the trick.

For newer (5.2+) Rails versions use

rake app:update:bin
like image 115
Kesha Antonov Avatar answered Oct 23 '22 10:10

Kesha Antonov


When the script folder is missing from the Rails application folder it shows the above error.

I just copied it from another app and it worked for me.

like image 26
Gajendra Jena Avatar answered Oct 23 '22 11:10

Gajendra Jena


Before running the Rails server, you need to first create a Rails application.

For example, to create a new app call "test_app", run the following:

rails new test_app

Once your application is created, you can cd into the directory and start your server:

cd test_app
rails server
like image 3
countersixte Avatar answered Oct 23 '22 11:10

countersixte