简体   繁体   English

无法启动 Rails 服务器 - 一堆错误

[英]can't start Rails server - bunch of errors

I'm new on Ruby on Rails (actualy I'm new programming in general) and I tried to start a new server for my web app.我是 Ruby on Rails 的新手(实际上我是新编程),我尝试为我的 Web 应用程序启动一个新服务器。 I followed all the rules that were in the book, installed everything required (I hope I've installed it correctly), but it keeps giving me the following error:我遵循了书中的所有规则,安装了所需的一切(我希望我已经正确安装了它),但它一直给我以下错误:

My command -> C:\\Users\\Júlia\\work\\demo>ruby bin/rails server我的命令 -> C:\\Users\\Júlia\\work\\demo>ruby bin/rails server

C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:50:in `match?': invalid byte sequence in UTF-8 (ArgumentError)
        from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:50:in `chop_basename'
        from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:374:in `plus'
        from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:354:in `+'
        from C:/Ruby30-x64/lib/ruby/3.0.0/pathname.rb:420:in `join'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/settings.rb:444:in `global_config_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/settings.rb:93:in `initialize'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:330:in `new'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:330:in `settings'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:99:in `configured_bundle_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:95:in `bundle_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:639:in `configure_gem_home_and_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:81:in `configure'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:194:in `definition'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler.rb:143:in `setup'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/setup.rb:10:in `block in <top (required)>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/ui/shell.rb:136:in `with_level'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/ui/shell.rb:88:in `silence'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.28/lib/bundler/setup.rb:10:in `<top (required)>'
        from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/Júlia/work/demo/config/boot.rb:3:in `<top (required)>'
        from bin/rails:3:in `require_relative'
        from bin/rails:3:in `<main>'

I'm so frustrated right now, I keep doing things apparently right but something always has to go wrong!我现在很沮丧,我一直在做看似正确的事情,但总是会出错! Anyways, I hope someone will be able to help me here :(无论如何,我希望有人能够在这里帮助我:(

You can follow GoRails guide to install RoR on windows it will be much easier.您可以按照 GoRails 指南在 Windows 上安装 RoR,这会容易得多。 Here it is: Install Ruby On Rails on Windows 10这是:在 Windows 10 上安装 Ruby On Rails

Also after installing it you may face some other issues related to your database ( whatever database you use) like you may have installed Postgresql on windows, so when after installing it on WSL you need to kill the one running on the port that WSL will use, and similar issues, all solved across the internet此外,在安装它之后,您可能会遇到一些与您的数据库(您使用的任何数据库)相关的其他问题,就像您可能在 Windows 上安装了 Postgresql,因此在 WSL 上安装它后,您需要杀死在 WSL 将使用的端口上运行的那个,以及类似的问题,都在互联网上解决了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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