Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

typing 'rails console' doesn't start?

I typed this:

>rails console 

and got this:

Usage:   rails new APP_PATH [options]  Options:       [--skip-gemfile]        # Don't create a Gemfile   -d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)                               # Default: sqlite3 .. .. . 

I'm following along the rails tutorial and got stuck on this.

I have rails 3.0 installed.

like image 501
Blankman Avatar asked Sep 19 '10 05:09

Blankman


2 Answers

In case anyone else hits this, my symptoms were:

I'd deployed my application with Capistrano 3

I cd'd into my application directory, and rails console didn't work

Turned out I'd included the bin folder as a symlinked directory in my cap deploy, as follows:

set :linked_dirs, %w{log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

... and my bin directory in 'shared' was empty.

Two fixes:

  • Ensure your linked bin directory has the correct contents (have a look inside your #{RAILS_ROOT}/bin directory for what this is, OR
  • Don't symlink bin

I then re-deployed and it works.

like image 160
Guillaume Roderick Avatar answered Oct 17 '22 03:10

Guillaume Roderick


Are you in the root path of your app when you type $ rails console?

Tip: $ rails c is a shortcut for $ rails console

like image 24
Yannis Avatar answered Oct 17 '22 01:10

Yannis