简体   繁体   中英

Trouble deploying rails into amazon ec2 - URI::InvalidURIError

On my amazon EC2 server, after I install ruby/rails/rbenv I run into an URI::InvalidURIError error. I'm not sure if I might have an issue with the way I installed 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'

Somehow, you managed to add an invisible <U+FEFF> character at the end of your command-line:

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

Remove this character from your command-line, and your server should boot fine:

rails s -p 3000 -b 0.0.0.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM