jekyll: Error : Could not locate Gemfile or .bundle/ directory
- I believe this to be a bug, not a question about using Jekyll.
- I updated to the latest Jekyll (or) if on GitHub Pages to the latest
github-pages
- I read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
- This is a feature request.
- I am on (or have tested on) Ubuntu GNU/Linux
- I was trying to install.
My Reproduction Steps
Could not locate Gemfile or .bundle/ directory
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 49 (30 by maintainers)
While this isn’t technically a bug in Jekyll itself, the fact that Jekyll’s Quick-start guide instructions do not work out of the box on arguably one of the more popular (and layman-/beginner-oriented) Linux distros out there (i.e. stock Ubuntu, which I can confirm for a 16.04 LTS install) could be seen as a documentation bug.
First, the bad news:
The premature closing of this report is discouraging. Unfortunately this “see no ‘evil’, hear no ‘evil’, don’t let anyone speak ‘evil’” attitude is very common wherever bugtrackers are used. Probably a matter of non-farsighted contributors ignorantly responding to incorrect incentives (which latter would be the real problem – don’t reward the closing of bug reports irrespective of outcome).
The good news is that I have a solution to the issue at hand:
The clue lies beyond the Quick-start guide, in the more formal installation requirements, where the need to install ruby “including development headers” is parenthetically mentioned. On Ubuntu, those headers are in the
ruby-all-dev
package, sosudo apt-get install ruby ruby-all-dev
should do the trick. All of the dozens of googleable StackExchange responses glibly telling people to just change into the right directory (and then again shutting down the conversation, cf. above) are red herrings. Withruby-all-dev
installed, the Quick-start guide should work and the Could not locate Gemfile or .bundle/ directory error message should not occur.It would be a good idea to include a link/hint to that extent in the relevant documentation.
I can’t really speak for @jsroyal, but the answer could be that as of v16.04 LTS there also is a jekyll .deb package available in Ubuntu’s repositories.
I experimented with that at some point, but I could not get things to work using that .deb package, so I completely uninstalled everything (including ruby) and started over, and that’s how I figured out what does work (so far – knocks wood).
I’m just bringing this up because (A) I just remembered, (B) I think it’s conceivable @jsroyal also tried that package (did you?) and ended up with that directory after getting things to partially work with the .deb, and © maybe it’s also useful to tell Ubuntu users not to use that package but follow the official Quick-start guide. OTOH, maybe that’s taking distro hand-holding a bit far. I dunno. Somebody else decide this; I’m just saying.
No, that’s expected from newer versions of Jekyll. Please refer our docs on that matter.
Since its telling you that you can ignore those warnings, you need not worry. They’re not related to Jekyll.
On 28 May 2017 at 02:47, Vasyl Khrystyuk notifications@github.com wrote:
Try:
sudo apt-get install ruby2.3-dev
You’re likely missing ruby development headers.
This is documented http://jekyllrb.com/docs/installation/#requirements/, but you’re right in that it could still be better documented (don’t blame me; I submitted a diff):
I’m having the same problem. My Jekyll version stays at 3.0.1 even after I install ruby-dev.
I have to use sudo to install Jekyll at all and then each time I get:
Could not locate Gemfile or .bundle/ directory
@pathawks:
This may not be the place, but the thing that annoyed me about ffi is that its documentation/wiki seems to suffer from what I’d call recursive obliviousness syndrome:
If you don’t know what FFI means and stands for, the documentation doesn’t tell you, and doesn’t tell you where to find out, so if you don’t know, you can’t find out because you don’t know.
On the other side, those documentation authors who do know what FFI means just assume that people know, so they’ll never say because they assume that people know.
Recursive obliviousness on both sides. And never the twain shall meet.
This hubristic “we’re important; people know us; no need for introductions” assumption is VERY common in organisation names and open source projects for some reason. I suspect a subset of overconfident abbreviation users don’t themselves know the meaning either, but are simply incurious enough to never ask.
But yeah, I eventually dug deep and found out that an FFI is a foreign function interface, and yadda, yadda, yadda (thanks, Wikipedia).
@ashmaroli: Thank you.
Of course there is no @jekyll/linux team :rage2:
@pathawks Unfortunately, my knowledge (of bundler and gemfiles, etc.) is limited. All I can really reliably report at this point is that:
After installing just the
ruby
.deb on a stock Ubuntu 16.04 LTS box (and finding that that package seemed to include rubygems), I followed the current/old Jekyll quick-start guide and got the Could not locate Gemfile or .bundle/ directory error at thebundle exec jekyll serve
stage.Some googling revealed that I wasn’t the only person whose Jekyll efforts were thwarted by this – and that’s also how I found this thread.
I eventually figured out that also installing the
ruby-all-dev
package before following the quick-start guide seems to fix the issue.(NB: I think the gem installs of jekyll and bundler required sudo, but I didn’t really consider that an issue – if someone thinks otherwise, then maybe the documentation or code could be changed to account for that as well.)
If someone has a spare machine that they can reboot, they could probably boot Ubuntu 16.04 LTS or later from USB or LiveCD and confirm that I’m not making this up.
If I’ve done the forking/editing/pull request stuff correctly earlier, then I’ve submitted proposals as to how installation.md and quickstart.md could be changed to make things easier for current Ubuntu etc. users.
Whether it’s even feasible to change jekyll or bundler so as to not require whatever
ruby-all-dev
includes that makes things work, I don’t know. I also don’t know if it’s possible to distinguish and produce a more meaningful error message.That’s about the extent of my knowledge, unfortunately.
@jsroyal If I understand you correctly, you meant to ask if there is another way to create a GitHub page, other than installing Jekyll on your local Ubuntu box and staging things from there. You remarked that you preferred to do things without the local installation which depends on having a ruby developing environment set up, because you are not familiar with ruby. You are looking for some kind of instant online posting option.
Have I understood you correctly?
I don’t unfortunately know the answer, but I at least wanted to make sure that your question was understood.
@quiltbag How about:
and then directly below that:
Given Ubuntu’s “market share”, it might then make sense to explicitly mention the Could not locate Gemfile or .bundle/ directory error and its likely fix with
ruby-all-dev
on the requirements page.Of course it’s not feasible to handhold every Linux distro, but maybe there’s something to be said for striking a balance between keeping it short & generic, and giving likely users, or up-and-coming would-be users a leg up.
@jsroyal, what is the output you get when you run
$ jekyll -v
? and when you run$ jekyll new myblog
?Could not locate Gemfile or .bundle/ directory*