Hi. Im new to Rails 8 (about 2 hours in) and i’m struggling to get it up and running.
So what I’m trying to do is to get an app up and running to play about with along with tailwindcss. Watched the Youtube vids and it looked pretty easy.
Where im at now.
I have run rails new my-great-app
nd it runs through the process and then hits a problem:
bin/rails aborted!
Bundler::GemRequireError: There was an error while trying to load the gem 'debug/prelude'. (Bundler::GemRequireError)
Gem Load Error is: cannot load such file -- debug/prelude
Backtrace for gem load error is:
It wont let me do anything after this. Any help or advice on this would be grateful. Thats all I get when searching on line is AI slop and random stackoverflow post on other issues.
Cheers
What platform, what install technique did you use to get your dev environment going? Does gem env
give you any meaningful output? Are you using rvm
, rbenv
or similar to manage your active Ruby version? Rails 8 will require a modern version of Ruby, at least 3.3, or 3.4, and unless you have that configured correctly with a version switcher, you may be at the mercy of whatever (low) version of Ruby came with your computer’s OS.
(updated) also, what exact version of Rails do you have installed in your current Ruby version?
Walter
Hi.
I was following the instruction from the Rails Site to get it up and running from here: https://guides.rubyonrails.org/install_ruby_on_rails.html#install-ruby-on-macos.
Once i have run that I cd into the directory and run bin/dev
and then i get the error.
Versions are:
- Macbook M1 - OSX Sequoia
- Ruby 3.4.5
- Rails 8.0.2
- Not using anything like rvm or rbenv.
For the gem env
the output is:
RubyGems Environment:
- RUBYGEMS VERSION: 3.6.9
- RUBY VERSION: 3.4.5 (2025-07-16 patchlevel 51) [arm64-darwin24]
- INSTALLATION DIRECTORY: /opt/homebrew/Cellar/tmuxinator/3.3.4/libexec
- USER INSTALLATION DIRECTORY: /Users/chris/.gem/ruby/3.4.0
- CREDENTIALS FILE: /Users/chris/.local/share/gem/credentials
- RUBY EXECUTABLE: /Users/chris/.local/share/mise/installs/ruby/3.4.5/bin/ruby
- GIT EXECUTABLE: /usr/local/bin/git
- EXECUTABLE DIRECTORY: /opt/homebrew/Cellar/tmuxinator/3.3.4/libexec/bin
- SPEC CACHE DIRECTORY: /Users/chris/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/chris/.local/share/mise/installs/ruby/3.4.5/etc
- RUBYGEMS PLATFORMS:
- ruby
- arm64-darwin-24
- GEM PATHS:
- /opt/homebrew/Cellar/tmuxinator/3.3.4/libexec
- /Users/chris/.gem/ruby/3.4.0
- /Users/chris/.local/share/mise/installs/ruby/3.4.5/lib/ruby/gems/3.4.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => true
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/chris/.local/share/mise/installs/ruby/3.4.5/bin
- /opt/homebrew/bin
- /opt/homebrew/bin
- /Users/chris/Library/Application Support/Herd/config/nvm/versions/node/v21.7.3/bin
- /Users/chris/Library/Application Support/Herd/bin/
- /opt/homebrew/bin
- /opt/homebrew/bin
- /Users/chris/Library/Application Support/Herd/config/nvm/versions/node/v21.7.3/bin
- /Users/chris/Library/Application Support/Herd/bin/
- /opt/homebrew/bin
- /Users/chris/Library/Application Support/Herd/config/nvm/versions/node/v21.7.3/bin
- /Users/chris/Library/Application Support/Herd/bin/
- /opt/homebrew/bin
- /Users/chris/.local/bin
- /Users/chris/Library/Application Support/Herd/config/nvm/versions/node/v21.7.3/bin
- /Users/chris/Library/Application Support/Herd/bin/
- /usr/local/bin
- /System/Cryptexes/App/usr/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
- /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
- /Library/Apple/usr/bin
- /opt/homebrew/bin
- /Users/chris/Library/Application Support/Herd/config/nvm/versions/node/v21.7.3/bin
- /Users/chris/Library/Application Support/Herd/bin/
- /opt/anaconda3/bin
- /opt/anaconda3/condabin
- /opt/homebrew/sbin
- /Users/chris/.cargo/bin
- /Applications/Ghostty.app/Contents/MacOS
- /Users/chris/development/flutterSDK/bin
- /Users/chris/.composer/vendor/bin
- /Users/chris/.lmstudio/bin
Many thanks
I managed to get passed that error by modifying the default Gemfile config that was set during install.
# from
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
# to
gem "debug", platforms: %i[mri windows]
:s
Now im onto the next error 
/Users/chris/.local/share/mise/installs/ruby/3.4.5/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require': cannot load such file -- racc/parser.rb (LoadError)
Yeah, this is going to persist until you pick a version manager and use it. You’ve got a decent Ruby installed, but it’s in the homebrew path, and probably not owned by the same user as your app. Bundler will want to put the gems somewhere, and by default, that’s going to be in a path relative to the installed ruby. What you did above, where you just got rid of the explicit require, that just let it skip on to the next thing that implicitly requires a file, and that’s just the same problem in different clothes.
There are a lot of opinions out there around which version manager you should use, but the exact one is not as important as picking one and using it. I would step back here. Use Homebrew to uninstall this ruby, and then, in a different shell, follow whichever manager’s README and step through installing it. I personally use RVM, but I am old, and newer opinions differ. Rbenv has a lot of traction, and a lot of good guidance on Stack Overflow if/when you get stuck.
Walter
Oh, I mis-read something important in your gem env above: you are using a version manager: mise. But the paths in the rest of the gem env look like maybe you tried a few other things before you landed on mise. In your test app’s project directory, do you see either a .ruby-version or .tool-versions file? What are the contents of that file?
Ah ok, so it is simular if not the same as Python with pipenv. I’ll have to look a bit more into that.
So i do have a .ruby-version
file with ruby-3.4.5
and thats it on there.
So initially i went through the initial install instruction on the rails docs, and then encountered a problem, which then resulted in a bit of searching for answers, which then ended up in a blind cut and paste scinario not knowing or reading up in the docs about what could be the issue. So i think i installed rvm
to see if that worked which then resulted in a few more errors.
I’ll dig in a bit more into the versioning and see if i can rewind back a few stages.
Cheers
Rvm has a very handy rvm implode
that does a complete reverse of everything it ever did. I have run it maybe three times in the last 15 years.
So I managed to get this fixed eventually. I think the main issue was with my Macbook M1, or simply put Apple Silicon.
I ran:
$ gem install racc -v 1.8.1 -- --with-cflags="-arch arm64"
$ bundle config set force_ruby_platform true
$ bundle install
This avoids the build fail inside the Nokogiri dependency chain. force_ruby_platform
disables the use of precompiled native gems (like Nokogiri’s universal binary) and forces local builds—which are more compatible on Apple Silicon when properly configured.
Understood, but honestly not necessary here. I’ve been using the pre-compiled version on my M1 Max since it became available. I really appreciate the effort that the Nokogiri team have put into this – the speed of install is just night and day, versus my “day job” where we still have to do this business on a couple of gems because our production server doesn’t have a new enough GCC. And even for those, we work around it by setting the force_ruby_platform key in the gemfile, conditioned on whether the build platform is darwin or not.
gem 'nokogiri', force_ruby_platform: !RUBY_PLATFORM.include?('arm64-darwin')
Note the ! in there. This only runs the full compile if the platform is NOT Apple Silicon, which means that our CI deploy is slower (but successful) since that’s where we have the problem. In your case, you might find that you have to do the opposite, and the speed benefits on a modern “standard” Linux are astounding.
Don’t let this slow down your learning process now that you have something working, but do circle back and see if it fixes this particular issue on your Mac. The speed benefits during build and deploy are really worth it.
Walter
Ah ok ill have to set that stright away on a new project
Still got a load of learning to do with it, but thats the best way to learn is to break it and fix it!
But… I got it working and loving it so far. Im coming over from Laravel and now i can see how much influence Rails has had on Laravel features.