basecamp / pow

Zero-configuration Rack server for Mac OS X
http://pow.cx/
MIT License
3.4k stars 261 forks source link

Failed to load resource: net::ERR_ADDRESS_UNREACHABLE #497

Open ep-wac opened 9 years ago

ep-wac commented 9 years ago

I have 2 apps running without a glitch - but this third – clock – one is really bumming me out!

clock/ (master *) $ ls -la ~/.pow/
total 24
drwxr-xr-x  5 enrique  staff  170 20 Jan 11:14 .
drwxr-xr-x  5 enrique  staff  170 16 Jan 10:32 ..
lrwxr-xr-x  1 enrique  staff   45 20 Jan 09:17 clock -> /Users/enrique/Documents/Projects/Rails/clock
lrwxr-xr-x  1 enrique  staff   45 20 Jan 08:57 leanr -> /Users/enrique/Documents/Projects/Rails/leanr
lrwxr-xr-x  1 enrique  staff   48 20 Jan 08:56 lindholm -> /Users/enrique/Documents/Projects/Rails/lindholm

leanr and lindholm works without any hickups at all - clock does not load assets at all , listing it in Chrome Developer Tools (CDT) like this:

Failed to load resource: net::ERR_ADDRESS_UNREACHABLE
http://localhost:3000/assets/employees.css?body=1

Failed to load resource: net::ERR_ADDRESS_UNREACHABLE
http://localhost:3000/assets/entrances.css?body=1

In my layout file (application.html.haml) I have this:

!!!
%html
  %head
    %meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0"}
    %title= content_for?(:title) ? yield(:title) : 'Leanr'
    %meta{:name => "description", :content => "#{content_for?(:description) ? yield(:description) : 'Leanr'}"}
    = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags
  %body
    %header
      = render 'layouts/navigation'
    %main{:role => "main"}
      = render 'layouts/messages'
      = yield

it is to-the-letter an exact copy of the equivalent template in my leanr app!

But in the CDT this layout turns into the following (for the clock app)

<link data-turbolinks-track="true" href="http://localhost:3000/assets/accounts.css?body=1" media="all" rel="stylesheet">

and this (for the leanr - and other apps)

<link data-turbolinks-track="true" href="/assets/application.css?body=1" media="all" rel="stylesheet">

which obviously is the right way - loosing the 'host' part of the request

Both Gemfiles are built with the RailsComposer and infact identical! -

source 'https://rubygems.org'
ruby '2.1.5'
gem 'rails', '4.1.5'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'spring',        group: :development
gem 'bootstrap-sass'
gem 'devise'
gem 'devise_invitable'
gem 'haml-rails'
gem 'high_voltage'
gem 'mysql2'
gem 'pundit'
gem 'simple_form'
gem 'upmin-admin'
group :development do
  gem 'better_errors'
  gem 'binding_of_caller', :platforms=>[:mri_21]
  gem 'capistrano', '~> 3.1.0'
  gem 'capistrano-bundler'
  gem 'capistrano-rails', '~> 1.1.0'
  gem 'capistrano-rails-console'
  gem 'capistrano-rvm', '~> 0.1.1'
  gem 'foreman'
  gem 'html2haml'
  gem 'quiet_assets'
  gem 'rails_layout'
  gem 'spring-commands-rspec'
end
group :development, :test do
  gem 'factory_girl_rails'
  gem 'faker'
  gem 'pry-rails'
  gem 'pry-rescue'
  gem 'rspec-rails'
  gem 'rubocop'
  #gem 'thin'
end
group :production do
  gem 'unicorn'
end
group :test do
  gem 'capybara'
  gem 'database_cleaner'
  gem 'launchy'
  gem 'selenium-webdriver'
end

I'm pretty sure it must be my doing - how could otherwise lindholm and leanr be OK? So the question remains: What in the name of sweat Jesus am I doing wrong? Some kind of config that adds the http//localhost:3000 to my clock app - or removes it from other apps??

valachi commented 9 years ago

I have got the same issue after i updated an app to use rails 4.2. All assets are blocked with GET http://localhost:3000/assets/application.css?body=1 net::ERR_ADDRESS_UNREACHABLE . Though i can normally access assets directly (like appname.dev/assets/application.css?body=1).

If i start a rails server normally with rails s, then appname.dev works just ok.

Thank you