You can call Rails::Server.new.options[:Port]
to get the port that your Rails server is running on. This will parse the -p 3001
args from your rails server
command, or default to port 3000
.
More Related Contents:
- Explain like I'm LITERALLY five…what does it mean to "format" a string? [closed]
- Convert string to XXX
- How to change default timezone for Active Record in Rails?
- Understanding the Rails Authenticity Token
- Rails :include vs. :joins
- What is the best method of handling currency/money?
- How to get a random number in Ruby
- Installing Bootstrap 3 on Rails App
- Rails 4 Authenticity Token
- Rails 5: ActiveRecord OR query
- usage of attr_accessor in Rails
- Getting the warning “Insecure world writable dir /home/chance ” in PATH, mode 040777 for rails and gem
- How to test for (ActiveRecord) object equality
- ruby 2.0 rails gem install error “cannot load such file — openssl”
- How do I wrap link_to around some html ruby code?
- How to match accented characters with a regex?
- ‘require’: cannot load such file — ‘nokogiri\nokogiri’ (LoadError) when running `rails server`
- Suppress Ruby warnings when running specs
- What are the brackets [5.1] after ActiveRecord Migration and how does it work? [duplicate]
- f.error_messages in Rails 3.0
- EOFError: end of file reached issue with Net::HTTP
- Rails Paperclip how to delete attachment?
- Rails Migrations: tried to change the type of column from string to integer
- String.force_encoding() in Ruby 1.8.7 (or Rails 2.x)
- Ruby on Rails 3 howto make ‘OR’ condition
- Rails catch-all/globbing routes
- Always getting 401 Unauthorized with new install of Rails + Devise
- using has_many :through and build
- Why won’t Heroku accept my Gemfile.lock in Windows?
- Rails engines extending functionality