Rails 5服务器问题(Windows 10) [英] Rails 5 Server Issues (Windows 10)

查看:169
本文介绍了Rails 5服务器问题(Windows 10)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的Ruby on Rails的新手,我刚刚安装了Ruby& Windows 10上的Rails(Ubuntu shell中的Bash)。我似乎在启动Rails服务器时遇到了问题。已经在该问题上检查了其他线程,但其他人都在使用OSX。 (希望有人可以帮忙!)
$ b $

当运行rails s时,

  root @ TEAMROCKETHQ:〜/ newapp#rails s 
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/app_loader .rb:40:警告:不安全的可写dir /root/.rbenv/versions在PATH中,模式040777
=>启动Puma
=> Rails 5.0.2应用程序从http: // localhost:3000
=>为更多启动选项运行`rails server -h`
Puma以单一模式启动...
*版本3.8.0(ruby 2.4.0- p0),代号:Sassy Salamander
*最小线程数:5,最大线程数:5
环境:开发
*听取tcp:// localhost:3000
使用Ctrl-C停止

对于第一行的问题,我试过了:

  sudo chmod 775 / usr / local 

它似乎没有做任何事情。也许我读错误错误,但我不知道...当我去localhost:3000,它返回这个错误:

  =>启动Puma 
=> Rails 5.0.2应用程序从http:// localhost:3000
=>开始开发。运行`rails server -h`以获得更多启动选项
Puma以单一模式启动...
*版本3.8.0(ruby 2.4.0-p0),代号:Sassy Salamander
*最小线程数:5,最大线程数:5
环境:开发
*听取tcp:// localhost:3000
使用Ctrl-C停止
2017-03-09 23 :17:26 -0600:读取错误:#< Errno :: EINVAL:无效参数 - getsockopt(2)>
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:124:in`getsockopt'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:124:in`closed_socket?'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:563:in`handle_request'
/ root / .rbenv / versions / 2.4.0 / lib / ruby​​ / gems / 2.4.0 / gems / puma-3.8.0 / lib / puma / server.rb:425:在`process_client'
/ root / .rbenv / versions / 2.4.0 / lib / ruby​​ / gems / 2.4.0 / gems / puma-3.8.0 / lib / puma / server.rb:289:在`block in run'
/ root / .rbenv / versions / 2.4.0 / lib / ruby​​ / gems / 2.4.0 / gems / puma-3.8.0 / lib / puma / thread_pool.rb:120:在`block in spawn_thread'

网页:


$ b localhost 页面isn 't正在运行



localhost 当前无法处理此请求。

HTTP ERROR 500

解决方案

这是因为 pum一个3.8.0



放置 gem'puma','3.7.1'在你的gem文件中,再次 bundle install

gem卸载puma 版本 3.8.0 ,等到有修复。


Newbie to Ruby on Rails here, I just did a fresh install of Ruby & Rails on Windows 10 (Bash on Ubuntu shell). I seems to having issues on starting the Rails server. Already checked the other threads on the issue, but everyone else is using OSX. :( Hope someone can help!

When running rails s,

root@TEAMROCKETHQ:~/newapp# rails s
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.0.2/lib/rails/app_loader.rb:40: warning: Insecure world writable dir /root/.rbenv/versions in PATH, mode 040777
=> Booting Puma
=> Rails 5.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.0 (ruby 2.4.0-p0), codename: Sassy Salamander
* Min threads: 5, max threads: 5
Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop

For the first line issue, I tried:

sudo chmod 775 /usr/local

it seems it didn't do anything. Maybe I'm reading the error wrong, but I don't know... When I go to localhost:3000, it returns this error:

=> Booting Puma
=> Rails 5.0.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.0 (ruby 2.4.0-p0), codename: Sassy Salamander
* Min threads: 5, max threads: 5
Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
2017-03-09 23:17:26 -0600: Read error: #<Errno::EINVAL: Invalid argument - getsockopt(2)>
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:124:in `getsockopt'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:124:in `closed_socket?'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:563:in `handle_request'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:425:in `process_client'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/server.rb:289:in `block in run'
/root/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.8.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'

Webpage:

The localhost page isn't working

localhost is currently unable to handle this request.

HTTP ERROR 500

解决方案

It is because puma 3.8.0.

Put gem 'puma', '3.7.1' in your gem file, and bundle install again.

And gem uninstall puma at version 3.8.0, wait until there is a fix.

这篇关于Rails 5服务器问题(Windows 10)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆