Cannot find bundler gem for a Jekyll blog - ruby

I'm trying to setup a new Jekyll site and am running into issues after I create a new site using jekyll new testSite.
I get an error saying:
New jekyll site installed in /Users/myPath.
Dependency Error: Yikes! It looks like you don't have bundler or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- bundler' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
jekyll 3.3.1 | Error: bundler
I've installed bundler already using gem install bundler, but it can't seem to find it.
bundler -v gives Bundler version 1.14.2
jekyll -v gives jekyll 3.3.1
Thanks in advance!

given that you have ruby, jekyll and blunder correctly installed. inside testSite folder run:
bundle
bundle (or bundle install, cf. bundler doc) will Install the dependencies specified in your Gemfile.
then run your new website, with:
bundle exec jekyll s

The below command worked for me, in ubuntu.
sudo apt install ruby-bundler

Related

bundler: command not found: jekyll

I have a project for uni where we need to build upon an existing project.
To view it locally I need to build it with Jekyll. I have never worked with it and am generally not very experienced with coding. To build the website we are supposed to use
bundle exec jekyll build -d public
Now this gives me the error
bundler: command not found: jekyll
Install missing gem executables with `bundle install`
When I check my ruby version it says
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin20]
Also tried some PATH redirecting so which ruby gives me
/usr/local/opt/ruby/bin/ruby
the gems are under
/usr/local/opt/ruby/bin/gem
I'm pretty lost now and not sure what to do.
I'm working on a Mac btw :)
Thanks for any help
Do you have the Jekyll gem installed?
gem install jekyll

Jekyll Serve not working

I have downloaded zip of this github repo - https://github.com/mmistakes/minimal-mistakes
I have installed bundler and I did bundle install , it worked perfectly.
Now when I try to run jekyll serve -w,
WARN: Unresolved specs during Gem::Specification.reset:
jekyll-watch (~> 1.1) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. Configuration file:
/home/kenden/Desktop/minimal-mistakes-master/_config.yml
Dependency
Error: Yikes! It looks like you don't have jekyll-paginate or one of
its dependencies installed. In order to use Jekyll as currently
configured, you'll need to install this gem. The full error message
from Ruby is: 'cannot load such file -- jekyll-paginate' If you run
into trouble, you can find helpful resources at
http://jekyllrb.com/help/!
jekyll 3.1.3 | Error: jekyll-paginate
However when I do, gem list, it shows me jekyll-paginate (1.1.0) along with all the other gems that are installed.
How to solve this issue?
I was able to solve it using gem cleanup followed by bundle exec jekyll serve.
If gem cleanup and bundle exec jekyll servedoesn't work.
Then try bundle add webrick. After that you can try bundle exec jekyll serve.
And it should work.

what's causing jekyll to throw a "undefined method `require_from_bundler'" error on any command?

I'm working on a jekyll site on Ubuntu 15.04 and when i try jekyll serve (or any other jekyll command, with or without sudo) i receive the following:
/var/lib/gems/2.1.0/gems/jekyll-3.1.2/bin/jekyll:9:in `<top (required)>': undefined method `require_from_bundler' for Jekyll::PluginManager:Class (NoMethodError)
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
I have worked on jekyll sites on this computer recently without this issue, and I'm not certain how the configuration changed to generate this error. I've tried gem uninstall jekyll and reinstalling it, same issue happens. I'm not a Ruby dev and I'm a bit at a loss for how to troubleshoot this.
Well, I suggest you to run Jekyll with Bundler, which is an awesome dependency manager. It will make sure you have all the gems you need.
1st. Uninstall Jekyll 2.2.0. This version is too old and requires Python to run some dependencies. Jekyll 3.x does not require Python anymore.
So, run sudo gem uninstall jekyll --version 2.2.0. (or gem uninstall jekyll -v 2.2.0)
2nd. Now, install Bundler:
gem install bundler (or sudo gem install bundler)
3rd. Add a Gemfile (don't give it any extension) to your site root with the following content:
source "https://rubygems.org"
gem 'jekyll', '3.1.2'
This will make sure you will have installed Jekyll 3.1.2 and all its dependencies.
If you will deploy your site to GitHub, the Gemfile must be different:
source "https://rubygems.org"
gem 'github-pages'
This will include the Jekyll version running at GitHub pages at the time.
4th. Using the terminal, cd path/to/path to your site root and run bundle install there. Bundler will install all the dependencies for you and create a new file called Gemfile.lock, which will have a list of all dependencies installed for that project.
5th. Run bundle exec jekyll serve
Done!
NOTE 1: I recommend you to use Jekyll 3.0.3, as I think it's better then 3.1.2 (it seems there are some bugs on 3.1.2 which don't have in 3.0.3). Anyway, opinion based tip - it's up to you.
NOTE 2: If you don't have openssl installed to your computer, replace the protocol in your Gemfile:
source "https://rubygems.org"
replace for
source "http://rubygems.org"
For reference:
Jekyll 2x-to-3x
Jekyll on GitHub
That's it! Hope to have helped!

Travis reports odd message of corrupted Gemfile.lock

Im using bundler to install stuff and since I have added Gemfile.lock, travis started to complain with:
Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES
section: 'echoe'
Of course, everything works locally. It also works using DeployBot. I even installed docker ubuntu and tried, still ok. My Gemfile.lock is not corrupt. Same versions of ruby and bundler is used.
What is going on?
Update
This is something related to bundler version. Im using 1.11.0, but got reports that it worked with eg. 1.8.3. ??
We've seen a very similar issue today on Buildkite due to the recent release of a new bundler version
https://rubygems.org/gems/bundler/versions/1.11.0
We got the build working by stipulating the version of bundler to install.
gem install -v 1.10.6 bundler --no-rdoc --no-ri
and forcing the use of that
bundle _1.10.6_ install
Firstly, remove the gem lock file:
rm -f Gemfile.lock
Then install the dependencies:
bundle install
You can update the dependencies to ensure that you won't get an error:
bundle update

bundle install fails on nokogiri

I'm installing some chef dependencies following this website:
https://learnchef.opscode.com/starter-use-cases/multi-node-ec2/
I got to the bundle install part, here's what my Gemfile looks like:
source 'https://rubygems.org'
gem 'berkshelf'
gem 'chef'
gem 'knife-ec2'
I get this error when I try to run
bundle install --path vendor:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
...
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
...
An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling.
I went to the nokogiri site and I was able to follow the directions and successfully install nokgiri 1.6.0 with homebrew .9.5:
nokogiri --version
WARNING: Nokogiri was built against LibXML version 2.9.1, but has dynamically loaded 2.8.0
# Nokogiri (1.6.0)
I get the same message when I then try running the bundle install again. I'm told that the bundle installer doesn't care about installs done outside of it. How to I get around this and install these dependencies?
After a little digging, I figured it out. This is specifically for OSX Mountain Lion.
The rbenv bundler needs to know the same paths specified using these switches given by the nokogiri site:
http://nokogiri.org/tutorials/installing_nokogiri.html
This is done using the bundler config command:
bundle config build.nokogiri --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar /libxslt/1.1.26 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
I still ran into troulbe because the config was only picking up the first line of that config setting. I had to edit $HOME/.bundle/config and take out some newlnes before it would take all of the switches. I hope this will save someone else some time.

Resources