4
respostas

não consigo acessar o http://localhost:3000/

quando tento entra fala que a conexão com localhost foi recusada. obs: to usando o windows 10 64bits

C:\Users\Ray\lojadecamisetas>rails server
=> Booting WEBrick
=> Rails 5.0.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0/lib/active_support/railtie.rb:22:in `rescue in block in <class:Railtie>': tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install (TZInfo::DataSourceNotFound)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0/lib/active_support/railtie.rb:19:in `block in <class:Railtie>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/initializable.rb:30:in `run'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `call'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/initializable.rb:54:in `run_initializers'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/application.rb:352:in `initialize!'
        from C:/Users/Ray/lojadecamisetas/config/environment.rb:5:in `<top (required)>'
        from C:/Users/Ray/lojadecamisetas/config.ru:3:in `require_relative'
        from C:/Users/Ray/lojadecamisetas/config.ru:3:in `block in <main>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `instance_eval'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:55:in `initialize'
        from C:/Users/Ray/lojadecamisetas/config.ru:in `new'
        from C:/Users/Ray/lojadecamisetas/config.ru:in `<main>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `eval'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:49:in `new_from_string'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/builder.rb:40:in `parse_file'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/server.rb:318:in `build_app_and_options_from_config'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/server.rb:218:in `app'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/server.rb:59:in `app'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-2.0.1/lib/rack/server.rb:353:in `wrapped_app'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/server.rb:124:in `log_to_stdout'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/server.rb:77:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:90:in `block in server'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'
4 respostas

Olá, Ray, tudo bem?

Tenta deixar o seu Gemfile desse jeito:

source 'https://rubygems.org'

gem 'rails', '4.2.1' 

gem 'sqlite3'    // banco de dados

gem 'jquery-rails'    // elementos visuais

gem 'turbolinks'    // links internos

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

O que mudou aí é que foi adicionada a gem tzinfo-data. Nos foi reportado que isso é necessário para quem roda o Rails no Windows.

Depois de alterar o arquivo, roda o bundle install no projeto, para baixar a gem. Aí tenta novamente o rails server.

Avisa aqui se funcionou?

Abraços.

Oi, Ray, será que conseguiu resolver o problema?

Olá, eu tive esse mesmo problema, consegui resolver usando a solução dada pelo Lucas Félix, porém tive que fazer alguns ajustes, deixo aqui meu codigo do Gemfile: (Para Windows)

source 'https://rubygems.org'

gem 'rails', '5.1.3' 

gem 'sqlite3'   

gem 'jquery-rails' 

gem 'turbolinks'   

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

source 'https://rubygems.org'

Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '~> 5.1.4'

Use sqlite3 as the database for Active Record

gem 'sqlite3'

Use Puma as the app server

Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks

gem 'turbolinks', '~> 5'

Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder

gem 'jquery-rails'

Use jquery as the JavaScript library

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'listen'

rapaziada, deu o mesmo biriri comigo e pediram pra adicionar a gem listen e deu tudo certo ;)