Search code examples
ruby-on-railsamazon-web-servicesamazon-elastic-beanstalkcloud9-ideaws-codestar

Unable to run rails console/server in AWS Cloud9 CodeStar EB dev Ruby on Rails environment


I created my first environment with CodeStar and selected the Ruby on Rails w/ Elastic Beanstalk option. I'm using AWS Cloud9 for the IDE. I'd like to use the Preview option to view the impact of code changes prior to committing, and have looked through the docs at http://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html, however I can't seem to get a server running in the development environment.

From within my environment directory in the Cloud9 terminal (path: /home/ec2-user/environment/env_name) I tried rails s -b $IP -p $PORT as documented for the previous non-AWS Cloud9, and also rails server and even rails console just to check. In each case I just get the help details for rails new:

    $ rails s
        Usage:
          rails new APP_PATH [options]

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

What am I missing?


Solution

  • Per the discussion on this question, this behavior indicates that rails does not recognize that it is running in a rails directory so it thinks the only valid action is rails new. There were several suggested answers, but the one that worked for me was to run rake rails:update:bin (or rake app:update:bin for Rails 5).