无法在AWS Cloud9 CodeStar EB dev Ruby on Rails环境中运行rails console / server

时间:2022-08-25 07:52:28

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.

我使用CodeStar创建了我的第一个环境,并选择了带有Elastic Beanstalk选项的Ruby on Rails。我正在使用AWS Cloud9作为IDE。我想使用预览选项在提交之前查看代码更改的影响,并查看了http://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview上的文档.html,但我似乎无法在开发环境中运行服务器。

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:

从我在Cloud9终端的环境目录中(路径:/ home / ec2-user / environment / env_name)我尝试使用rails s -b $ IP -p $ PORT,如前面的非AWS Cloud9所述,还有rails server和甚至rails控制台只是为了检查。在每种情况下,我只获得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?

我错过了什么?

1 个解决方案

#1


1  

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).

根据对此问题的讨论,此行为表明rails无法识别它在rails目录中运行,因此它认为唯一有效的操作是rails new。有几个建议的答案,但对我有用的是运行rake rails:update:bin(或rake app:update:bin for Rails 5)。

#1


1  

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).

根据对此问题的讨论,此行为表明rails无法识别它在rails目录中运行,因此它认为唯一有效的操作是rails new。有几个建议的答案,但对我有用的是运行rake rails:update:bin(或rake app:update:bin for Rails 5)。