我正在尝试运行rackup来运行ruby应用程序。我收到了这个错误。
C:\Ali\Ruby\App>rackup -p $PORT -o $IP
[2016-09-30 06:11:32] INFO WEBrick 1.3.1
[2016-09-30 06:11:32] INFO ruby 2.2.4 (2015-12-16) [i386-mingw32]
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/socket.rb:232:in `getaddrinfo': getad
drinfo: The specified class was not found. (SocketError)
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/socket.rb:232:in `foreac
h'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/socket.rb:459:in `tcp_se
rver_sockets'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/webrick/utils.rb:70:in `
create_listeners'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/webrick/server.rb:133:in
`listen'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/webrick/server.rb:114:in
`initialize'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:45
:in `initialize'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib
/rack/handler/webrick.rb:31:in `new'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib
/rack/handler/webrick.rb:31:in `run'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib
/rack/server.rb:286:in `start'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib
/rack/server.rb:147:in `start'
from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.4/bin
/rackup:4:in `<top (required)>'
from C:/RailsInstaller/Ruby2.2.0/bin/rackup:23:in `load'
from C:/RailsInstaller/Ruby2.2.0/bin/rackup:23:in `<main>'
有什么问题?任何帮助表示赞赏。
答案 0 :(得分:0)
从命令行路径判断,您使用的是MS-DOS。变量$PATH
和$IP
是Unix风格的变量。在MS-DOS下,您将使用%PATH%
和%IP%
。
尝试:
C:\Ali\Ruby\App> echo %PATH%
如果可行(显示长路径),请尝试进行更改。