我按照有关如何开始使用rails的教程,但最终得到的结果与视频不同。以下是使用命令rails s时收到的消息:
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `initialize': Permission denied - bind(2) for "127.0.0.1" port 3000 (Errno::EACCES)
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `new'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:263:in `block in add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:262:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:262:in `add_tcp_listener'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:105:in `block in parse'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `each'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `parse'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/runner.rb:144:in `load_and_bind'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/single.rb:87:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/launcher.rb:172:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/rack/handler/puma.rb:64:in `run'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/rack-2.0.1/lib/rack/server.rb:296:in `start'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/server.rb:79:in `start'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
编辑: 我在Windows上,并尝试以管理员身份运行命令提示符。结果相同。
编辑已解决:
technet.microsoft.com/en-us/library/ms345310(v = sql.100).aspx并重启你的电脑 - Chetan Mehta
答案 0 :(得分:1)
对于ubuntu:
尝试运行sudo rails s
确保你有sudo权限
如果端口繁忙,您可以尝试在其他端口上运行服务器。即:
rails s -p 3001
如果您使用的是窗口,则代替sudo尝试以管理员身份运行命令提示符