Jekyll bundler issue

I"m running macOS 10.15.4 and I think I accidentally changed my bundled gems location. When I instal I get:

Bundled gems are installed into `/Users/username/github/website.ext`

how do I reset? can I reset to the “default” via this jekyllrb article?


Are you sure they’re installed there? You can check your Gem paths by using gem environment or if you want info on a particular gem, you can use gem list -d <gem-name>

If you did indeed installed your gems in the wrong place, you can uninstall them with gem uninstall <gem-name>. Then in your project directory run bundle install again. It should then install them where you’ve installed Ruby. (I’m not a Mac user so I’m not sure how it works, but if I understand correctly Ruby comes installed by default. It might be worth asking a Ruby dev who uses macOS to get the details.)

Check your global bundler

view ~/.bundle/config

You might want to delete the config if it points to a project as it should point to user installed bundler gems. Or maybe not exist. (I never actually use that config though as I have everything at the project level except bundle itself installed with gem install)

Check your project config for bundler

view .bundle/config

Delete it. It will be created using config step below.

The common flow is to always configure bundler for a new clone so you don’t install into user bundle gems but the project gems. Also the config should be in version control as its different for prod deploy
See commands below I used every time on mac or linux

git clone ...
cd repo
bundle config --local path vendor/bundle

Then this install command will install to vendor in the project and it won’t ask for sudo

bundle install

If you have a vendor directory already in your project you can delete it and the install command will create it fresh

See also

gem list

bundle list

You can also uninstall and install bundler and delete and bundler vendor directories to reset.

Thank you Thank you thank you all so much this was so helpful