`bin/rails server` 打开文本文件而不是运行本地服务器

问题描述 投票:0回答:2

开始 Rails 教程:https://guides.rubyonrails.org/getting_started.html。 遵循了每个步骤,但是当我开始运行命令

bin/rails server
时,下面的文本文件将打开,而不是运行服务器。我如何获得此命令来运行服务器?

    #!/usr/bin/env ruby.exe
    APP_PATH = File.expand_path("../config/application", __dir__)
    require_relative "../config/boot"
    require "rails/commands"
ruby-on-rails ruby
2个回答
1
投票

尝试使用

rails server
rails s
,这是运行 Rails 服务器的更惯用的方法。


0
投票

但是每当我在命令行上运行 bin/dev 时,它都会从应用程序中打开 dev 文件,而不是运行命令和 foreman。如何摆脱这个问题?

© www.soinside.com 2019 - 2024. All rights reserved.