The error:
'require': cannot load such file -- xcodeproj (LoadError)
means that "generate_hash" script is trying to load the xcodeproj gem, but Ruby can't find it. This usually happens for one of the following reasons:
🔍 Common Causes & Fixes
1. Gem Not Installed
You likely haven't installed the xcodeproj gem yet.
Fix: Open terminal and run:
gem install xcodeproj
If you're using a specific Ruby version manager like rbenv or rvm, make sure you're installing it under the correct Ruby environment.
2. Script Not Running in the Same Gem Context
You may have installed the gem, but "generate_hash" is running in a different environment (e.g., system Ruby vs. a version-managed Ruby).
Fix: Check your Ruby version and gem list:
ruby -v
gem list | grep xcodeproj
Also try running your script like:
bundle exec ruby generate_hash
If you're using a Gemfile, make sure it includes:
gem 'xcodeproj'
Then run:
bundle install
3. Gem Installed for a Different User (Permissions Issue)
Sometimes the gem is installed globally but not accessible to your user.
Fix: Try reinstalling with:
sudo gem install xcodeproj
Or better, avoid sudo and use a Ruby version manager like rbenv or rvm.
If you’re still stuck, please contact us with more details for how you're running the script, what your Ruby version is, and whether you're using a Gemfile.