0

When type rails console under the deploy subdir on ubuntu, instead of firing up the console, it displays help message for rails:

Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice

However irb can fire up without error. Anyone knows why? Thanks so much.

user938363
  • 9,990
  • 38
  • 137
  • 303

1 Answers1

1

Check this answer here: typing 'rails console' doesn't start?

You need to make sure that your current directory is the base directory of a rails app, because the rails console command needs to load the environment of that app.

Community
  • 1
  • 1
Rick Button
  • 1,212
  • 13
  • 19
  • I am in root. Now it return error saying js runtime could not be found. – user938363 Mar 03 '12 at 05:46
  • Rails cannot find a proper JavaScript runtime, so you need to add one to the Gemfile in your project root. Append `gem 'execjs'` and `gem 'therubyracer'` to your Gemfile and run `bundle install` in the root of the app. – Rick Button Mar 03 '12 at 05:48