0

I am a newbie at Ruby on Rails and I just follow the Getting Started official documentation in order to start a new Rails application.

While I am trying to run the server I am getting a LoadError which I know little off, i.e.:

PS C:\Users\john\Desktop\John Snow\Projects\Tractări Auto Flex\flex-site\bin> rails server
bin/rails:3:in `require_relative': cannot load such file -- C:/Users/john/Desktop/John Snow/Projects/Tract?ri Auto Flex/flex-site/config/boot (LoadError)
        from bin/rails:3:in `<main>'

My guessing is that it has to do with the path that contains diacritics since I can easily notice that ă in the path is not recognized by rails and gets formatted as an ? or maybe I am wrong and it is something else I am missing.

Any suggestions on how I can circumvent this error are much appreciated.

I am using Ruby 3.0.3p157 and Rails 6.1.4.1.

ISimion
  • 108
  • 8
  • 2
    Well, put the project in another path. Ideally the path should be simple without spaces or special chars. Ex: c:/proiecte/tractari_auto/. See if it works. – razvans Dec 04 '21 at 11:15
  • @razvans Well, thank you, it does get past that error using a much simpler path. But now I wonder, is it Rails not working at all with paths with spaces or special characters, or is there anything that could be done to work on the initial path I was using? ... Maybe this is a question for another topic I would guess, idk. – ISimion Dec 04 '21 at 11:37
  • 1
    I lot of years ago I started Rails on Windows, it was Rails 2.3 and I had issues with paths with spaces. That's how I know it. Since then I use simple paths everywhere. Didn't put much thought into why it does not work, proabably it's a windows thing. – razvans Dec 04 '21 at 12:09
  • For references, there is an [issue](https://github.com/rails/rails/issues/29087) closed about this, but there was no solution involved. Also, the same behavior was reported on another [answer](https://stackoverflow.com/a/32456278/7698694). – ISimion Dec 04 '21 at 13:15
  • Similar problem https://stackoverflow.com/questions/26079788/special-characters-in-file-paths-on-windows-c – Ray Baxter Dec 05 '21 at 08:18

1 Answers1

0

In the bin/rails file, there is require_relative for loading a boot file for the initialize app.

Try to run the rails server command in the C:\Users\john\Desktop\John Snow\Projects\Tractări Auto Flex\flex-site path, not inside the bin directory

If that doesn't work, check if the boot.rb file is in the config folder.

ouflak
  • 2,458
  • 10
  • 44
  • 49
uamin
  • 36
  • 3
  • Ok, tried to run the command in the specified path, did not work, got the same error. Also, I confirm that `boot.rb` is there. Thanks for the suggestions. – ISimion Dec 04 '21 at 11:03