【问题标题】:Running "rails s" causes help page to be printed out运行“rails s”会导致打印出帮助页面
【发布时间】:2017-10-10 03:14:26
【问题描述】:

我以前从未见过这个奇怪的问题。我在 EC2 实例上有一个 Rails 4.2.5 应用程序。 Ruby 版本是 2.3.1。

一切捆绑和安装都很好,但是当我运行rails s 时,我最终得到了其他标志的手册页以提供给rails

直接从终端:

$ rails s
bin/rails:6: warning: already initialized constant APP_PATH
/home/ubuntu/githubstars/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:
 destroy      Undo code generated with "generate" (short-cut alias: "d")
 plugin new   Generates skeleton for developing a Rails plugin
 runner       Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information.

$ rails -v
Rails 4.2.5

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 amazon-ec2 rvm


    【解决方案1】:

    您缺少 bin 目录。在某处生成一个新项目并将 bin 文件夹复制过来。

    【讨论】:

    • 我继承了这个项目,结果发现所有这些 require/load 都在干扰。谢谢!
    • 您也可以拨打bundle exec rake rails:update:bin
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-13
    • 2012-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多