# Unable to locate Gemfile when installing Algolia plugin

**URL:** <https://meta.discourse.org/t/unable-to-locate-gemfile-when-installing-algolia-plugin/288948>\
**Category:** Self-hosting\
**Tags:** algolia-search\
**Created:** [December 17, 2023, 1:10am UTC](https://meta.discourse.org/t/unable-to-locate-gemfile-when-installing-algolia-plugin/288948 "2023-12-17T01:10:13Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![ontologize](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ontologize/32/349334_2.png) [@ontologize](https://meta.discourse.org/u/ontologize)\
**Post date:** [December 17, 2023, 1:10am UTC](https://meta.discourse.org/t/unable-to-locate-gemfile-when-installing-algolia-plugin/288948/1 "2023-12-17T01:10:13Z")

</div>

**Summary**  
In the process of installing the Algolia plugin, when I go to [perform the first index](https://github.com/discourse/discourse-algolia?tab=readme-ov-file#initial-indexing), I receive the error `Could not locate Gemfile or .bundle/ directory` when running the command `LOAD_PLUGINS=1 bundle exec rails algolia:reindex`.

**Context**  
This is a self-hosted site using a DigitalOcean droplet. I followed the [official installation instructions](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md) and everything went fine. The site works and I’m now customizing the look & feel, installing plugins, etc.

I began installing the Algolia plugin according to the instructions on github [1]. Everything went as expected until I got to the initial indexing step.

The command you need to run is `LOAD_PLUGINS=1 bundle exec rails algolia:reindex` and it says to run it “in your discourse directory” – I assume that is `/var/discourse` since that’s worked for everything else so far.

The error I receive is `Could not locate Gemfile or .bundle/ directory`. I took a look at this post [2], but I couldn’t really make heads or tails of what I was supposed to be doing, and it’s 7yrs old at this point. I also looked at the troubleshooting page here [3], but wasn’t able to figure out a solution. FWIW the ruby version is 3.1.2p20.

The Algolia plugin is the first plugin I’ve installed. Apart from adding a couple categories and changing some colors via the admin UI, I haven’t modified the site or installation in any way.

I get the sense that the installation process should have created a gemfile or bundle/ directory? I reviewed the installation procedure to make sure I didn’t miss a step and I don’t think I did.

Any thoughts on what I might have done wrong and/or what I should do in order to get the reindex command to succeed?

// Since my account is brand new I’m only allowed to add two links, so here are the rest for reference:

1. github [dot] com/discourse/discourse-algolia?tab=readme-ov-file#discourse-algolia-beta
2. meta.discourse [dot] org/t/bundle-install-could-not-locate-gemfile-or-bundle-directory/41292
3. github [dot] com/discourse/discourse/blob/main/docs/TROUBLESHOOTING.md

---

_[View the full topic](https://meta.discourse.org/t/unable-to-locate-gemfile-when-installing-algolia-plugin/288948)._
