How does one downgrade jekyll to work with github pages? - ruby

I think my main issue is that jekyll 4 is not support by github pages. That is fine with me, but how do I downgrade jekyll to work regardless?
I tried following the instructions here: https://github.com/github/pages-gem/issues/577
which basically seem to suggest to use an older version of jekyll. Im fine with doing that but it seems bundle refuses to obey me and I don't know why or I get into a weird loop I can't get out of.
So the main error I get is:
$ bundle
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
You have requested:
jekyll ~> 3.8.5
The bundle currently has jekyll locked at 4.0.0.
Try running `bundle update jekyll`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
but it seems that I am locked to 4. I tried unlocking but I can't seem to get that to work. My most recent attempt is the following:
$ gem install jekyll -v 3.8.5
Fetching kramdown-1.17.0.gem
Fetching jekyll-3.8.5.gem
Fetching sass-listen-4.0.0.gem
Fetching sass-3.7.4.gem
Fetching jekyll-sass-converter-1.5.2.gem
Fetching i18n-0.9.5.gem
Successfully installed kramdown-1.17.0
Successfully installed sass-listen-4.0.0
Ruby Sass has reached end-of-life and should no longer be used.
* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
* For more details, please refer to the Sass blog:
https://sass-lang.com/blog/posts/7828841
Successfully installed sass-3.7.4
Successfully installed jekyll-sass-converter-1.5.2
Successfully installed i18n-0.9.5
Successfully installed jekyll-3.8.5
Parsing documentation for kramdown-1.17.0
Installing ri documentation for kramdown-1.17.0
Parsing documentation for sass-listen-4.0.0
Installing ri documentation for sass-listen-4.0.0
Parsing documentation for sass-3.7.4
Installing ri documentation for sass-3.7.4
Parsing documentation for jekyll-sass-converter-1.5.2
Installing ri documentation for jekyll-sass-converter-1.5.2
Parsing documentation for i18n-0.9.5
Installing ri documentation for i18n-0.9.5
Parsing documentation for jekyll-3.8.5
Installing ri documentation for jekyll-3.8.5
Done installing documentation for kramdown, sass-listen, sass, jekyll-sass-converter, i18n, jekyll after 8 seconds
6 gems installed
but then after I tried to bundle my Gemfile using the command bundle I get the following error:
$ gem install jekyll -v 3.8.5
Fetching kramdown-1.17.0.gem
Fetching jekyll-3.8.5.gem
Fetching sass-listen-4.0.0.gem
Fetching sass-3.7.4.gem
Fetching jekyll-sass-converter-1.5.2.gem
Fetching i18n-0.9.5.gem
Successfully installed kramdown-1.17.0
Successfully installed sass-listen-4.0.0
Ruby Sass has reached end-of-life and should no longer be used.
* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
* For more details, please refer to the Sass blog:
https://sass-lang.com/blog/posts/7828841
Successfully installed sass-3.7.4
Successfully installed jekyll-sass-converter-1.5.2
Successfully installed i18n-0.9.5
Successfully installed jekyll-3.8.5
Parsing documentation for kramdown-1.17.0
Installing ri documentation for kramdown-1.17.0
Parsing documentation for sass-listen-4.0.0
Installing ri documentation for sass-listen-4.0.0
Parsing documentation for sass-3.7.4
Installing ri documentation for sass-3.7.4
Parsing documentation for jekyll-sass-converter-1.5.2
Installing ri documentation for jekyll-sass-converter-1.5.2
Parsing documentation for i18n-0.9.5
Installing ri documentation for i18n-0.9.5
Parsing documentation for jekyll-3.8.5
Installing ri documentation for jekyll-3.8.5
Done installing documentation for kramdown, sass-listen, sass, jekyll-sass-converter, i18n, jekyll after 8 seconds
6 gems installed
ok fine I'll try to update and I do bundle update:
$ bundle update
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies....
Bundler could not find compatible versions for gem "jekyll":
In Gemfile:
github-pages was resolved to 4, which depends on
jekyll (= 1.1.2)
jekyll-feed (~> 0.12) was resolved to 0.12.1, which depends on
jekyll (>= 3.7, < 5.0)
Bundler could not find compatible versions for gem "jekyll-feed":
In Gemfile:
github-pages was resolved to 36, which depends on
jekyll-feed (= 0.2.3)
minima (~> 2.5) was resolved to 2.5.0, which depends on
jekyll-feed (~> 0.9)
Bundler could not find compatible versions for gem "tzinfo":
In Gemfile:
tzinfo (~> 1.2)
tzinfo-data was resolved to 1.2019.3, which depends on
tzinfo (>= 1.0.0)
which gets me stuck...any ideas what to do?
I also tried to follow the instructions in my Gemfile with no success:
$ bundle update github-pages
Could not find gem 'github-pages'.
by running the command they say, I get the error:
$ bundle update github-pages
Could not find gem 'github-pages'.
I also ran this bundle install:
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "jekyll-feed":
In snapshot (Gemfile.lock):
jekyll-feed (= 0.12.1)
In Gemfile:
github-pages was resolved to 36, which depends on
jekyll-feed (= 0.2.3)
minima (~> 2.5) was resolved to 2.5.1, which depends on
jekyll-feed (~> 0.9)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "kramdown":
In snapshot (Gemfile.lock):
kramdown (= 2.1.0)
In Gemfile:
github-pages was resolved to 8, which depends on
kramdown (= 1.0.2)
minima (~> 2.5) was resolved to 2.5.1, which depends on
jekyll-feed (~> 0.9) was resolved to 0.12.1, which depends on
jekyll (>= 3.7, < 5.0) was resolved to 4.0.0, which depends on
kramdown (~> 2.1)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Bundler could not find compatible versions for gem "minima":
In snapshot (Gemfile.lock):
minima (= 2.5.1)
In Gemfile:
minima (~> 2.5)
github-pages was resolved to 94, which depends on
minima (= 1.0.1)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
I also did:
gem install github-pages
which installed...not sure if this made things worse...
Resources I've used to help me:
https://github.com/github/pages-gem/issues/577
https://github.com/github/pages-gem/issues/555
https://talk.jekyllrb.com/t/unlock-bundle-from-jekyll-version/3508
How can I install an older version of Jekyll?
https://github.com/github/pages-gem/issues/651
https://help.github.com/en/github/working-with-github-pages/creating-a-github-pages-site-with-jekyll#creating-your-site
but none have solved my issue yet.

Your Gemfile should look like :
source 'https://rubygems.org'
# will install all gh-pages allowed gems
# see : https://pages.github.com/versions/
gem 'github-pages'
# comment out all other gems
# gem 'jekyll'
# gem 'jekyll-feed'
# gem ...
Remove Gemfile.lock
You can now do a bundle and it will install all needed gems to test against actual github-pages version.

The current version of github pages requires you set use Jekyll 3.8.5 and github-pages 202. When I set this up, I also had to set a specific version for jekyll feed. Here's the relevant lines you need in your Gemfile:
gem "jekyll", "~> 3.8.5"
gem "github-pages","~> 202" , group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.11.0"
end
After that, try removing your Gemfile.lock and running bundle install.
I have a repo here with a minimal version set up.

Related

I am not able to install any new gem in my rails application.Its a issue related to bundler

Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (~> 5.2) was resolved to 5.2.3, which depends on
bundler (>= 1.3.0)
solargraph was resolved to 0.38.0, which depends on
bundler (>= 1.17.2)
Current Bundler version:
bundler (1.16.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (>= 1.17.2)', which is required by gem 'rails (~> 5.2)', in any of the sources.
ERROR: 6
I am using ruby version 2.5.1 on my device and rvm is not installed earlier the version of ruby 3.0.2 but our project is of version 2.5.1. But while installing any new gem and hitting bundle install it shows this particular error
sudo docker-compose run --rm --no-deps web bundle install

Bundler could not find compatible versions for gem "globalize":

Hi everyone I have recently started developing with this framework, I am having difficulties in starting a project locally.
When I go to run a
bundle install
I get this error message:
Bundler could not find compatible versions for gem "globalize": In Gemfile:
globalize java
globalize-accessors java was resolved to 0.2.1, which depends on
globalize (>= 5.0.0, ~> 5.0)
Could not find gem 'globalize (>= 5.0.0, ~> 5.0)', which is required by gem 'globalize-accessors', in any of the relevant sources: https://github.com/globalize/globalize.git (at master#bcfa30f)
Bundler could not find compatible versions for gem "globalize-accessors": In snapshot (Gemfile.lock):
globalize-accessors (= 0.2.1)
In Gemfile:
globalize-accessors java
Running `bundle update` will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resolve the conflict.
this is the part of the gemfile concerned:
########## Globalization
gem "route_translator", git: "https://github.com/enriclluelles/route_translator.git"
gem 'activemodel-serializers-xml'
gem 'globalize-accessors'
gem 'globalize', github: 'globalize/globalize'
gem 'kaminari', github: "amatsuda/kaminari", branch: '0-17-stable'
gem "kaminari-i18n"
i also tried to run bundle update but it didn't fix the problem
Ruby version:2.3.3
gem -v:2.5.2
The version of globalize in your gemfile seems not to correspond to the version required for globalize-accessors.
Try installing globalize like so :
gem 'globalize', "~> 5.0"

Jekyll version questions

If I run jekyll -v in terminal, I got this:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /usr/local/opt in PATH, mode 040777
jekyll 4.1.0
But if I run gem list jekyll, it says I have another version of jekyll:
*** LOCAL GEMS ***
jekyll (2.4.0)
jekyll-coffeescript (1.2.2)
jekyll-gist (1.5.0)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.5.2)
jekyll-watch (1.5.1)
Does it mean I have two different versions of Jekyll installed? and how can I choose to use the old version 2.4.0? and is it possible to uninstall the 4.1.0?
Thanks
I am answering both of your questions:
How can I choose to use the old version 2.4.0?
So, it is actually done through Gemfile in the project. Just mention gem 'jekyll', '2.4.0' in your Gemfile.
Is it possible to uninstall the 4.1.0?
Yes. Run gem uninstall Jekyll --version 4.1.0

Bundler could not find compatible versions for gem "bundler": In Gemfile:

I'm making GitHub blog page with Jekyll. I've failed like numerous times and just forked new one and followed README on the repository.
It's https://github.com/janczizikow/sleek/blob/master/README.md
and I tried to run inside the directory(master) but this msg keeps coming out.
I tried 'gem install bundler' 'gem cleanup' and similar solutions on the internet but still can't fix it. I get that I need another version which is lower one, then how can I remove the current one and install the version I need?
I've never used Ruby so I'm SO lost. A little advice will mean a lot.
bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (~> 1.12) x64-mingw32
Current Bundler version:
bundler (2.0.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (~> 1.12)' in any of the relevant sources:
the local ruby installation
Version 2.0.2 comes from gem install bundler, but the project uses bundler version 1.12.
To fix your issue run
gem install bundler -v 1.12
bundle _1.12_ install
To start Jekyll run jekyll serve or bundle exec jekyll serve.

after bundler installed with specific version why version of bundler did not change?

I got following error for bundle
Bundler could not find compatible versions for gem "bundler": In
Gemfile:
bundler (~> 1.15)
Current Bundler version:
bundler (2.0.1) This Gemfile requires a different version of Bundler. Perhaps you need to update Bundler by running gem install
bundler?
Could not find gem 'bundler (~> 1.15)' in any of the relevant sources:
the local ruby installation
then I tried to downgrade the bundler version with
$ gem install bundler -v '~> 1.7.0' Fetching: bundler-1.7.15.gem
(100%) Successfully installed bundler-1.7.15 Parsing documentation for
bundler-1.7.15 Installing ri documentation for bundler-1.7.15 Done
installing documentation for bundler after 1 seconds 1 gem installed
but when I recheck the bundler version with
bundler --version
it still said Bundler version 2.0.1
The default bundler version on your system is still 2.0.1. If you need to use the downloaded version 1.7.15, you would have to run bundle _1.7.15_ install. You could also check if that version was successfully installed on your system using bundle _1.7.15_ -v
In either case, if you get the error Could not find command "_1.7.15_", then that means that the bundler version _1.7.15_ has not been installed on your system.
Additionally, these links may help you:
Run specific version of bundler
Downgrade Bundler in RVM
Try updating bundle with bundler update bundler and run the bundle update again. It solved my problem the last time.

Resources