Bundle using old version of jekyll - ruby

I am trying to preview a site I have built in the past, using jekyll. Since then, I believe there have been updates to jekyll, and I now use zsh on MacOS 10.15.2. I'm having trouble now running a preview because it seems bundle keeps using an old version of jekyll.
When I run bundle exec jekyll server --unpublished I receive this error:
(base) ➜ angoodkind.github.io git:(master) ✗ bundle exec jekyll server --unpublished
Configuration file: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/_config.yml
NOTE: Inheriting Faraday::Error::ClientError is deprecated; use Faraday::ClientError instead. It will be removed in or after version 1.0
Faraday::Error::ClientError.inherited called from /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/vendor/cache/ruby/2.6.0/gems/octokit-4.14.0/lib/octokit/middleware/follow_redirects.rb:14.
Source: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io
Destination: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Error reading file /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/blog/index.html: (<unknown>): did not find expected key while parsing a block mapping at line 7 column 5
Error: could not read file /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/vendor/cache/ruby/2.6.0/gems/jekyll-3.5.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb: Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/cache/ruby/2.6.0/gems/jekyll-3.5.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
Invalid date '<%= Time.now.strftime('%Y-%m-%d %H:%M:%S %z') %>': Document 'vendor/cache/ruby/2.6.0/gems/jekyll-3.5.2/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date in the YAML front matter.
However, the system should be using jekyll 4.0.0, which was recently installed. Why is it using jekyll 3.5.2?

Related

Issue installing ceedling in Windows 11

I have tried to install ceedling for Windows 11. But come across this error:
Failed to load C:/ProgramData/gemrc, (<unknown>): control characters are not allowed at line 1 column 1
I installed Ruby 3.1.3.1 (x64) from here https://rubyinstaller.org/downloads/
Then I ran:
gem install ceedling
Any ideas on how to install ceedling correctly would be appreciated.
That error is telling you that the file C:\ProgramData\gemrc has invalid data in it at line 1, column 1. You have most likely edited this file improperly when installing Ruby because this is a default file with a default configuration that should have been created when you installed Ruby.
You should try these steps in order:
Inspect the file to see what invalid characters exist at that position, comparing it to some default gemrc files, and remove any invalid characters, or:
Rename the file and try again, or:
Remove the file and reinstall Ruby from scratch so that the file is created from scratch

Ruby on Rail running apache show index of when accessing the site

I have recently updated to Apache 2.4, and I am using Ruby on Rail to run my application. Following the upgrade, the site shows a content as seen in the image below, and the error on the log file shows this error message. I have tried using the 'Bundle Install' and checked the permission but that hasn't helped. Any advice would be greatly appreciated. Thanks
[ 2022-02-07 07:47:24.5559 8104/7efc89c8f700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/adminuser/hroot: An error occured while starting up the preloader.
Error ID: ba7e6074
Error details saved to: /tmp/passenger-error-RA01E9.html
Message from application: libmysqlclient.so.18: cannot open shared object file: No such file or directory - /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/gems/mysql2-0.3.14/lib/mysql2/mysql2.so (LoadError)
PassengerRuby /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/wrappers/ruby
SetEnv GEM_HOME /root/.gem/ruby/1.9.1
This error shows a problem with the shared objects. You probably updated MySQL/MariaDB libraries with Apache and new libraries are incompatible with your mysql2 gem build. The solution is simple:
First, ensure you are using the ruby-2.0.0-p353#hroot RVM environment.
Then, execute the following command:
gem install mysql2 --version 0.3.14
This should rebuild your mysql2 gem for the new MySQL/MariaDB client libraries on your system.
this isn't the answer anyway but another method to run ruby (in my case Windows 10 ; if you use another OS try to find out how to modify inside index.php the ruby starter)
i post here an alternative method to use apache + php +... and ruby
https://stackoverflow.com/a/71733656/5781320

Jekyll Build Not Working after MacOS High Sierra Update

Not sure if this is a bug, but I wasn’t able to find anything on the Web. Everything was working fine using a combination of Grunt, Jekyll and Homebrew to create my website. But once I updated to High Sierra the Jekyll build fails.
The way I usually run Jekyll build is via grunt-shell task like so:
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
jekyllBuild: {
command: 'jekyll build'
}
},
connect: {
server: {
options: {
hostname: 'localhost',
port: 4000,
base: '_build'
}
}
},
...
watch: {
jekyll: {
options: {
livereload: true
},
files: [
'**/*.scss',
'**/*.html',
'**/*.js',
// The negations must go after
'!*node_modules/**',
'!*_build/**',
'*.md',
'*.yml',
'img/**',
],
tasks: ['shell:jekyllBuild','postcss']
}
}
});
...
grunt.registerTask('serve', ['shell','connect','watch']);
Which gives the following error:
Running "shell:jekyllBuild" (shell) task
Configuration file: [URL]/_config.yml
Source: [URL]
Destination: _build
Incremental build: disabled. Enable with --incremental
Generating...
jekyll 3.6.0 | Error: negative argument
Warning: Command failed: jekyll build
Use --force to continue.
Aborted due to warnings.
Everything else I run works except Jekyll.
I also tried just running jekyll build without shell task but still got an error:
jekyll 3.6.0 | Error: negative argument
Warning: Command failed: jekyll build
Use --force to continue.
Aborted due to warnings.
I am using Homebrew to keep things local and everything seems to be in the correct location:
~$ which jekyll
/usr/local/bin/jekyll
~$ which ruby
/usr/local/bin/ruby
~$ which grunt
[URL]/.npm-packages/bin/grunt
~$ which gem
/usr/local/bin/gem
~$ which node
/usr/local/bin/node
I realize, my setup may not be the best, but it was working so I'm hoping for some guidance. I was not the one to initially create this setup and I'm not a programmer but rather a web designer who can hack things together to my own detriment at times :)
The issue ended up not being related to OS update, but rather a custom Jekyll plugin that was causing the issue. Once the plugin was removed everything worked. However, something did change perhaps in Jekyll or elsewhere to make the plugin not work all of the sudden. I will open a separate issue to figure that out. Thanks #Casper and #JoostS for quick responses.

Jekyll serve error - jekyll 3.2.1 Error: File exists # syserr_fail2_in

I'm attempting to migrate a Jekyll site over to my local machine and was doing ok but I've run into an error I am struggling to find much information regarding. I am pretty new to the whole Jekyll thing so any help is much appreciated.
When I run bundle exec jekyll serve I get the following error:
$ bundle exec jekyll serve
Configuration file: /home/Documents/devsite/websites/marketing/_config.yml
Source: /home/Documents/devsite/websites/marketing
Destination: /home/Documents/devsite/websites/marketing/_site
Incremental build: disabled. Enable with --incremental
Generating...
Building site for default language: "en-gb" to: /home/Documents/devsite/websites/marketing/_site
jekyll 3.2.1 | Error: File exists # syserr_fail2_in - /home/Documents/devsite/websites/marketing/_site/favicon.ico
I'm unsure as to what this error relates to so I'm a little unsure as to where to go next. Thanks for any help.

Error when run jekyll server on windows 7

I'm trying run Jekyll server in my local machine, so when I run jekyll server in terminal, returning fallowing message:
$ jekyll serve
Configuration file: C:/xxx/Site/_config.yml
Source: C:/xxx/Site
Destination: C:/xxx/Site/_site
Generating...
c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/posix-spawn-0.3.11/lib/posix/spawn.rb:164: warning: cannot close fd before spawn
'which' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.
Liquid Exception: No such file or directory - python c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/pygments.rb-0.6.0/lib/pygments/mentos.py in _posts/2015-06-02-welcome-to-j
ekyll.markdown
done.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for 'C:/xxx/Site'
Configuration file: C:/xxx/Site/_config.yml
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
Cause I trying enter http://127.0.0.1:4000/, is not happen, no error, no 404, only a empty page.
Where is problem?
Python does not appear to be installed, which is why you get a liquid exception when trying to use the code highlighter Pygments.
According to this tutorial, which is the suggested tutorial written by Julian Thilo on the Jekyll documentation, you need Python 2.7.x at time of writing. Here is a summary of what you need to do to get the Jekyll install and server up and running.
Step 1 : Get Python
Download the latest version of Python 2.7: here
Note: Make sure to add python.exe to Path and select “Entire feature will be installed on local hard drive. This is needed on Windows or else Jekyll will fail to build the website when trying to highlight code with Pygments.
Step 2: Install Pip
It's a Python package manager which you'll use to install Pygments. follow the official documentation for doing this.
Step 3: Get Pygments
Finally, Open up a command line and type in python -m pip install Pygments
Step 4 : Done
Run jekyll serve again.
Optional Step
Since Pygments is the default syntax highlighter, you don't have to explicitly define what highlighter you're using, but if you prefer to, add this line to your _config.yml file: highlighter : pygments
ALTERNATIVE 1: Don't want highlighters
If you won't be using a code highlighter just edit the markdown post you have 2015-06-02-welcome-to-jekyll.markdown and remove the Liquid tags like so:
{% highlight ruby %}
//Ruby code on the template you can ignore
{% endhighlight %}
ALTERNATIVE 2: Rouge, no need for Python
Rouge is a Ruby code highlighter, which while does not require Python and all that dependencies as it is written completely in Ruby (which you already have because Jekyll runs on Ruby). You'll need to edit the _config.yml to use rouge like so: highlighter : rouge, and run gem install rouge in the command line, as mentioned in same tutorial. Note that at time of writing Rouge has lesser language support compared to Pygments. (but still a whole lot)
Here's another tutorial on setting up Jekyll on Windows. And it would be a good idea to follow the excellent tutorial I've previously linked for installing Jekyll on Windows.

Resources