Search code examples
ruby-on-railsruby

`bin/rails server` opening a text file instead of running a local server


Starting a rails tutorial: https://guides.rubyonrails.org/getting_started.html. Followed every step but when I get to running the command bin/rails server the text file below opens instead of running a server. How do I get this command to run the server instead?

    #!/usr/bin/env ruby.exe
    APP_PATH = File.expand_path("../config/application", __dir__)
    require_relative "../config/boot"
    require "rails/commands"

Solution

  • try rails server or rails s instead, which is a more idiomatic way to run the Rails server.