Deploying jekyll app on Cloudcannon fails - jekyll

I am trying to deploy my jekyll app on the Cloudcannon CMS platform for Jekyll, but my build fails with this output:
Syncing raw files... done
Checking existing local bundle state... failed
Loading gem cache...
Checking gem cache (bundle_cache/Jw8rkIm9v3Cmawv2raEpkN96fz3R5X1Q_XMn7xpGB1s.zip)... no cache
$ export JEKYLL_ENV="production"
$ ruby -v
ruby 2.3.8p459 (2018-10-18 revision 65136) [x86_64-linux]
$ bundle version
Bundler version 2.0.1 (2019-01-04 commit d7ad2192f)
$ bundle config --global jobs 4
Configured concurrent installs!
$ bundle install
Using local cacheable path...
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
jekyll-feed-0.12.0 requires ruby version >= 2.4.0, which is incompatible with
the current version, ruby 2.3.8p459
What am I doing wrong and how can I update the ruby version correctly?
My Gemfile looks like this:
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.5"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 2.4.0"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?
I tried to change the jekyll-feed version and bundle it again but it gave me the same results and I don't want to remove that plugin because I need it.

The issue could be from your Gemfile.lock.
The latest version of jekyll-feed is 0.12.1
Correct your Gemfile to point to any version of jekyll-feed greater than or equal to 0.12.0:
gem "jekyll-feed", "~> 0.12"
The run bundle update so that the new version is installed and included in your Gemfile.lock
Then commit and push your updated Gemfile and the Gemfile.lock into your remote repository.

Jordan from CloudCannon here.
ashmaroli is correct, you're referencing an invalid version number for jekyll-feed. Following ashmaroli's steps should resolve the problem.
As a side note, we'll be adding support for multiple Ruby versions within the next month or two. This will resolve any future incompatibilities with plugins that require a later version of Ruby.
If you have any more questions feel free to contact us, we're more than happy to help :)

Related

Why is my completely new Jekyll blog blank when I add the supported Hacker theme?

I am trying to get started with a Jekyll blog. I followed these instructions to setup the blog using the default minima theme. This actually worked without any problems, but I wanted to change to the Hacker theme. To do that it simply asks for the following changes to me _config.yml:
remote_theme: pages-themes/hacker#v0.2.0
plugins:
- jekyll-remote-theme # add this line to the plugins list if you already have one
After making these changes I went to the URL https://galenseilis.github.io/ where I see that nothing renders anymore.
The current state can be observed at https://github.com/galenseilis/galenseilis.github.io, but everything should be the default values except where I made changes to the Gemfile and _config.yml. But since I may change the content of the repo as I troubleshoot, so here is a snapshot of these files:
Gemfile
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "~> 4.3.2"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
# gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
_config.yml
title: Your awesome title
email: your-email#example.com
description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll
# Build settings
# theme: minima
# theme: jekyll-theme-hacker
remote_theme: pages-themes/hacker#v0.2.0
plugins:
- jekyll-feed
- jekyll-remote-theme
Reverting the recommended changes for the Hacker theme back to the original state using minima theme returns the rending of the page. So maybe the changes I have made are insufficient if not incorrect somehow?

jekyll error building page related to kramdown parser

Whenever I run the bundle exec jekyll serve it returns the error
Dependency Error: Yikes! It looks like you don't have kramdown-parser-gfm 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 -- kramdown-parser-gfm' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
Liquid Exception: kramdown-parser-gfm in /_layouts/default.html
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
kramdown-parser-gfm
so, I tried gem install kramdown-parser-gfm, but it returns the same error after that.
I also tried to remove and reinstall the jekyll and bundle, but didn't work either.
jekyll version 3.9.0 Bundler version 2.1.4
I added gem "kramdown-parser-gfm" to the Gemfile and then ran bundle install.
Now the serve command completes successfully.
delete the Gemfile.lock file
go to gem file add gem "kramdown-parser-gfm"
open terminal and give command bundler
after install all packages, in terminal give command bundle exec jekyll serve
I hope application will run properly now.
On Windows
If you open your gemfile, you will notice the following.
gem "jekyll", "~> 3.2.1"
If you have the specific jekyll version and after running "bundler", you will receive the following errors.
Bundler could not find compatible versions for gem "kramdown":
In Gemfile:
jekyll (~> 3.2.1) was resolved to 3.2.1, which depends on
kramdown (~> 1.3)
kramdown-parser-gfm was resolved to 1.1.0, which depends on
kramdown (~> 2.0)
Remove the specific version of jekyll, like so:
gem "jekyll"
Do not forget to add webrick gem to gemfile
gem "webrick"
Run bundler again.
bundler
Finally, serve
bundle exec jekyll serve --livereload
What worked for me was to add:
gem "rexml"
to the Gemfile.

Jekyll plugin works locally but not on Travis CI

I've set up my site to build with Travis CI, and added a few plugins.
This is my Gemfile:
source "https://rubygems.org"
group :jekyll_plugins do
gem "github-pages"
gem "octopress-minify-html" # This one does not work on Travis
gem "jekyll-git_metadata"
gem "jekyll-paginate-v2"
gem "jekyll-tagging"
end
And this is my .travis.yml (with irrelevant information stripped)
language: ruby
cache: bundler
sudo: false
#install: use default `bundle install`
script: bundle exec jekyll build
after_success: .travis/deploy.sh
I tried building my site locally:
$ bundle update
$ bundle install
$ bundle exec jekyll build
And I can see the generated HTML files are minified.
But when I check pushed files from Travis CI, the HTML files are not minified. Also judging from build time, the plugin octopress-minify-html is not working (when it's working the build time is significantly longer).
I tried deleting my whole working directory and re-cloning from GitHub and this plugin is still working locally. I deleted Travis CI cache and let Bundler build everything again, but the plugin still doesn't work on Travis.
What went wrong on Travis?
You can force minification with octopress-minify-html by setting minify_html: true in your config file.

How do I install one of Github Pages' Jekyll themes for local preview?

I'm trying to install Github Pages' Slate theme on my CentOS 7 VM so I can locally preview my new site using the bundle exec jekyll serve command.
I followed the instructions as best as I could.
I changed the theme minima to jekyll-theme-slate in my _config.yml file.
Then I changed gem "minima", "~> 2.0" to gem "github-pages", group: :jekyll_plugins in my Gemfile file.
After that (since these are their only instructions), I ran bundle exec jekyll serve and it told me I had gems that weren't installed (duh), and suggested running bundle install.
I ran bundle install, which told me there was a conflict in version types of the dependencies and it suggested that bundle update could potentially resolve that issue.
No problem, I ran bundle update. A few plugins/features actually reverted versions here, but I got the Slate theme installed on my machine now, version 0.0.4 for whatever reason.
After that, I ran bundle exec jekyll serve again. I got this error:
Configuration file: /home/peri/my-site/_config.yml
Configuration file: /home/peri/my-site/_config.yml
jekyll 3.4.3 | Error: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
In a way, that error makes sense. For a custom theme to work, I probably need a tool to run their custom scripts. But first, I noticed this extra section in the theme's installation instructions, which directly mentions being able to locally preview the site with that theme.
I downloaded the source, instead of cloning it...I don't need the .git stuff do I?
I edited the script/bootstrap file because /usr/local requires root and using sudo doesn't know about any binary called gem or bundle. I changed gem and bundle to their respective absolute paths and ran sudo ./script/bootstrap inside of slate-master.
Point of the story is, it didn't work for my home/peri/my-site directory when I ran bundle exec jekyll serve. Presumably, it's because they intended for the user's site to be integrated into their theme's source code? That doesn't seem intuitive or correct. So, I investigated ExecJS.
I installed it. gem install execjs
I added gem "execjs", "2.7.0" to my Gemfile file.
Got the same error as before.
How am I supposed to install this Jekyll theme?
Follow these steps after changing the theme in _config.yml:
Gemfile should have only this content:
source "https://rubygems.org"
gem "github-pages"
remove bundler current config: rm -r .bundle/
remove Gemfile.lock: rm Gemfile.lock
Install local dependencies in an isolated folder just for this website: bundle install --path=vendor/bundle
You won't have post and page and home themes, you will need to use just default in all your posts.
Generate and run server: bundle exec jekyll s

Warbler does not package Java/JRuby gems?

I have a Ruby on Rails app that I want to compile/package as a WAR file to host in Tomcat. I've added all of the relevant stuff I can find, but the WAR only appears to include the non-JRuby versions of gems. As a result, I get GemNotFound exceptions such as "could not find activerecord-jdbc-adapter" in Tomcat. If I open the WAR file in 7-zip, it does not show any of the JRuby or Java gems under /WEB-INF/gems/gems.
Warbler does not report any errors or warnings, and the WAR appears to contain everything it needs, except for these gems.
(Because this is a lightweight, internal app, I'm using sqlite for now... which explains the sqlite gems. The DB is stored outside the project and configured in the database.yml file.)
The relevant snippet from my Gemfile:
if defined?(JRUBY_VERSION)
gem 'jdbc-sqlite3'
gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jruby-openssl'
gem 'jruby-rack'
else
gem 'sqlite3'
end
I also tried explicitly including/excluding these gems in the warble.rb file:
config.gems -= ["sqlite3"]
config.gems += [
"jdbc-sqlite3",
"activerecord-jdbc-adapter",
"activerecord-jdbcsqlite3-adapter",
"jruby-openssl",
"jruby-rack",
"warbler"
]
As an interesting side note, if I modify my Gemfile to demand the JRuby gems, jruby -S bundle install works fine but warble gives a series of errors stating that the gems are only for use with JRuby. On the other hand, if I try to run it within JRuby (jruby -S warble) I get:
warble aborted!
no such file to load -- jruby_pageant
How can I convince Warbler that I want the JRuby gems?
Edit:
I also tried specifying platforms in the gemfile, as described in this blog post, but this causes warble to stack-overflow.
platforms :jruby do
gem 'jdbc-sqlite3'
gem 'activerecord-jdbc-adapter', :require => false
gem 'activerecord-jdbcsqlite3-adapter', :require => false
gem 'jruby-openssl'
gem 'jruby-rack'
end
platforms :ruby do
gem 'sqlite3'
end
Versions:
ruby 1.9.3
jruby 1.7.4
warbler 1.3.8
So it turns out that I was missing the jruby-pageant gem. Once I added this to the bundle, jruby -S warble produced the expected output.