Getting rails console on an amazon aws server when using rvm

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You would like to get access to your rails application console on an Amazon ec2 instance, and you are also using rvm.

Solution

  • Login with ssh to your server as normal:
  • Go to your application’s current folder:
  • Run the following replacing the environment with your specific environment (ie production,beta,staging etc):
  • Gab Riel

    Im getting the following output:
    Usage:
    rails new APP_PATH [options]

    Options:
    -r, [–ruby=PATH] # Path to the Ruby binary of your choice
    # Default: /home/deploy/.rvm/rubies/ruby-2.3.3/bin/ruby
    -m, [–template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)

    and a bunch more options.
    How do I get access to rails c where I can query the db, run ruby code etc.

  • kosmasc

    Gab,

    you are using rails new, that creates a new application.

    You should be using rails c to access the rails console.