简体   繁体   English

Ruby on Rails在Windows上无法连接到localhost:3000、127.0.0.1:3000和0.0.0.0:3000

[英]Ruby on Rails can't connect to localhost:3000, 127.0.0.1:3000 and 0.0.0.0:3000 on Windows

I'm a total newbie learning Ruby on Rails and using a Windows machine. 我是一个学习Ruby on Rails并使用Windows机器的新手。 The steps used to install ruby on rails were: 在轨道上安装红宝石的步骤是:

  1. download ruby200-x64 installer for Windows 下载适用于Windows的ruby200-x64安装程序
  2. then run the following commands 然后运行以下命令

    • ruby dk.rb init
    • ruby dk.rb install
    • gem install bundler
    • gem install sqlite3
    • gem install rails
    • rails new testapp
    • cd testapp
    • bundle exec rails server which means that I ran rails server in the testapp folder and part of the output says this: bundle exec rails server ,这意味着我在testapp文件夹中运行了Rails服务器,部分输出显示了这一点:

      • Booting WEBrick 正在启动WEBrick
      • Rails 4.1.1 application starting in development on 0.0.0.0:3000 Rails 4.1.1应用程序从0.0.0.0:3000开始开发
      • Run rails server -h for more startup options 运行rails server -h获得更多启动选项
      • Notice: server is listening on all interfaces 0.0.0.0. 注意:服务器正在所有接口0.0.0.0上侦听。 Consider using 127.0.0.1 考虑使用127.0.0.1
      • Ctrl-C to shutdown server Ctrl-C关闭服务器
      • Exiting 退出
      • C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.2.1/lib/tzinfo/data_source.rb: No source of timezone data could be found. C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.2.1/lib/tzinfo/data_source.rb:找不到时区数据源。 Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error 请参考http://tzinfo.github.io/datasourcenotfound以获取解决此错误的帮助
      • Follow by more lines of codes (sorry, didn't have enough reputation points to post an image. 然后再输入更多行代码(对不起,抱歉,没有足够的声誉点来发布图片。
  3. Finally when I tried to connect to localhost:3000, 127.0.0.1:3000, or 0.0.0.0:3000. 最后,当我尝试连接到localhost:3000、127.0.0.1:3000或0.0.0.0:3000时。 None worked. 没有工作。 Any ideas? 有任何想法吗? I'm guessing it has to do something with the Exiting line. 我猜想它必须与Exiting Line做些事情。

The error indicates that TZInfo was unable to find a source of time zone data on your system. 该错误表明TZInfo无法在您的系统上找到时区数据源。 This will typically occur if you are using Windows. 如果使用Windows,通常会发生这种情况。

Resolving TZInfo::DataSourceNotFound Errors 解决TZInfo :: DataSourceNotFound错误

Try to install tzinfo-data gem by editing Gemfile and put gem 'tzinfo-data' and run bundle install 尝试通过编辑Gemfile来安装tzinfo-data gem,然后将Gemfile gem 'tzinfo-data'放入并运行bundle install

Or to use the ruby modules as the data source, running by 或者使用ruby模块作为数据源,运行方式为

gem install tzinfo-data

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在vagrant中无法连接localhost:3000 ruby​​ on rails - can't connect localhost:3000 ruby on rails in vagrant 无法连接到Localhost:3000 for Rails但127.0.0.1:3000可以工作 - Cannot connect to Localhost:3000 for Rails but 127.0.0.1:3000 works 为什么 Ruby on Rails 使用 http://0.0.0.0:3000 而不是 http://localhost:3000? - Why does Ruby on Rails use http://0.0.0.0:3000 instead of http://localhost:3000? 无法访问localhost:3000 ruby​​ on rails ubuntu - Can not acces localhost:3000 ruby on rails ubuntu Docker,使用docker flag -p 3000:3000无法从localhost:3000到达“rails server”开发 - Docker, can't reach “rails server” development from localhost:3000 using docker flag -p 3000:3000 在mac机器上可以访问localhost:3000但不能访问127.0.0.1:3000 - Can access localhost:3000 but not 127.0.0.1:3000 on mac machine ruby on rails不会加载欢迎页面(localhost:3000) - ruby on rails won't load welcome page(localhost:3000) Ruby on Rails Devise Always localhost:3000将被重定向 - Ruby on Rails Devise Always localhost: 3000 will be redirected Ruby on Rails-ActiveRecord :: ConnectionNot在localhost:3000上建立 - Ruby on Rails- ActiveRecord::ConnectionNotEstablished on localhost:3000 Ruby on Rails:http:// localhost:3000无法正常工作 - Ruby on Rails: http://localhost:3000 not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM