无法将rails部署到amazon ec2 - URI :: InvalidURIError

时间:2016-12-22 02:16:38

标签: ruby-on-rails amazon-web-services amazon-ec2

在我的amazon EC2服务器上,安装ruby / rails / rbenv后,我遇到URI::InvalidURIError错误。我不确定我安装rbenv的方式是否存在问题。

rails s -p 3000 -b 0.0.0.0
=> Booting Puma
=> Rails 5.0.1 application starting in development on http://0.0.0.0:3000 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.6.2 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity
* Min threads: 5, max threads: 5
* Environment: development
Exiting
home/ec2-user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/uri/rfc3986_parser.rb:21:in `split': URI must be ascii only "tcp://0.0.0.0\u{feff}:3000" (URI::InvalidURIError)
from /home/ec2-user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73:in `parse'
from /home/ec2-user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/uri/common.rb:227:in `parse'

1 个答案:

答案 0 :(得分:0)

不知何故,您设法在命令行的末尾添加了一个不可见的<U+FEFF>字符:

rails s -p 3000 -b 0.0.0.0[<U+FEFF> is here]

从命令行中删除此字符,您的服务器应该可以正常启动:

rails s -p 3000 -b 0.0.0.0