Home > Back-end >  Ruby on Rails error: `require_relative': cannot load such file
Ruby on Rails error: `require_relative': cannot load such file

Time:10-24

Working on learning Ruby and RoR over here. Got Ruby, Brew, Bundle and Rails installed. Created a local Rails project on my Mac and was ready to start the local rails server.

But I get an error and I'm just too new to figure out what I should do. Unfortunately the tutorial (which has been easy to follow up to this point) doesn't address what to do next.

Any suggestions would be extremely appreciated.

Here's the error:

... hello_world_ % rails server
Ignoring racc-1.6.0 because its extensions are not built. Try: gem pristine racc --version 1.6.0
bin/rails:3:in `require_relative': cannot load such file -- /Users/.../Dropbox/Mac/Documents/RailsProjects/hello_world_/config/boot (LoadError)
    from bin/rails:3:in `<main>'

CodePudding user response:

In this case, the error is giving you a suggestion. Run this command in your terminal:

gem pristine racc -v 1.6.0

CodePudding user response:

Try creating the empty file manually with name boot.rb in config folder and try running the server. if the build fails just add these line of codes in config/boot.rb file

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
  • Related