In the console, Rails 4 app.hostand the like gain access to the "integration session": it appears to be a placeholder for the console to work fully. Apparently, the application host is not configured. See The Pearl of the Railways.
Run from v4.0.2: railties-4.0.2/lib/rails/console/app.rb
module Rails
module ConsoleMethods
def app(create=false)
@app_integration_instance = nil if create
@app_integration_instance ||= new_session do |sess|
sess.host! "www.example.com"
end
end
def new_session
app = Rails.application
session = ActionDispatch::Integration::Session.new(app)
yield session if block_given?
session
end
end
end
new_session .