I am setting up Jekyll on my computer based on the information given on Jekyll's homepage. Ruby 2.6.3 was installed via rbenv.
In the first step I created a minimal Gemfile, containing only Jekyll
source "https://rubygems.org"
ruby "2.6.3"
group :base do
gem 'jekyll', '4.0.0'
end
I installed all gems via bundle install and as far as I can see they have been installed properly. I verified it via
user@host:homepage> bundle info jekyll
* jekyll (4.0.0)
Summary: A simple, blog aware, static site generator.
Homepage: https://jekyllrb.com
Path: /Users/user/.gem/ruby/2.6.0/gems/jekyll-4.0.0
According to the tutorial I should now be able to run Jekyll via bundle exec jekyll serve. If I now execute this command I alway get this error:
user@host:homepage> bundle exec jekyll serve
bundler: command not found: jekyll
Install missing gem executables with `bundle install`
Why can't Bundler find the installed gems?
I works only if run Bundler with the --path option like this: bundle install --path vendor/bundle. Then Bundler write also .bundle/config with the following content:
---
BUNDLE_PATH: "vendor/bundle"
In this case it is clear that Bundler is able to find the installed gems.
But shouldn't Bundler not also be able to find the gems installed without an explicit path? I would like to download and to install gems only once and not per project.