I'm working locally on a website that was build with Jekyll, and watching doesn't auto-regenerate changes I do in the code.
jekyll 2.2.0
ruby 2.1.1p76 via rvm
configuration file I use is default one from http://jekyllrb.com/docs/configuration/
Any suggestions? Thanks!
UPDATE #1: looks like something wrong in other area (gems? node.js?). Another project with Compass also unwatchible at the moment.
UPDATE #2: problem was solved after installation of "listen" gem.
You can often solve issues like this by using a Gemfile with bundle exec to ensure that all necessary gems are installed. Try putting the gems you need into a Gemfile, and then run bundle exec jekyll serve --watch to only use those gems.
Note: This answer is based off my previous comment.
In my case after experimenting with different combinations of versions of Ruby and Jekyll, I figured out that I don't have a "listen" gem. After installation of it auto regeneration works well.
Related
I just noticed that jekyll has all it needs installed locally, but a remote-theme is fetched every time jekyll is started.
I've also seen that people proposed a cache extension which hasn't been merged yet.
So I wonder if it is possible to just clone the remote theme to a certain folder?
ok, found the solution:
most themes are available also as ruby gems. So instead of specifying a remote-theme, I add the corresponding gem to Gemfile
gem "minimal-mistakes-jekyll"
and then reference it in the _config.yml
theme: minimal-mistakes-jekyll
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
I'm doing a tutorial on Ruby on Rails from Lynda, and everything has gone the way it should. All installations and everything has worked flawless.
But after creating a project, when I try to start the server (cmd: rails server) I get the error message:
LoadError: cannot load such file -- nokogiri/nokogiri
I have
* Windows 7 x64
* Rails 4.2.4,
* Gem 2.4.8.
I'm in the directory of the project. All files are there, everything looks ok. I created my project like this: ruby new test_cms and I also tried this: ruby new my_cms -d mysql . Same result.
Any ideas?
It looks as though nokogiri isn't be loaded, so you need it. So first think to do is check that it is in your Gemfile. If it is - move it to the top (I know - strange but it sometimes sorts out similar issues). If it's not, add it:
gem 'nokogiri'
Then run bundle install again.
Then try running bundle exec rails server to run the server with your bundle. You may be running it out of context.
If 'nokogirl' is located in your Gemfile maybe try updating your gems. try $ gem update --system.
I think I'm just at the finish line for installing jekyll on windows, It's connecting fine, but I'm getting an error message:
Liquid exception: No such file or directory - python C:/Ruby193/lib/ruby/ms/1.9.1/gems/pygments.rb-0.6.3/lib/pygments/mentos.py in _posts/2015-06-09-welcome-to-jekyll.markdown<-[0m done.
Please add the following to your Gemfile to avoid polling for changes: gem 'wdm','>=0.1.0' if Gem.win_platform
I'm not sure what messages I can ignore and what I need to fix. What do you guys think?
If adding this to my gemfile is as simple as entering a cmd prompt, what do I need to enter to install it?
This was an issue that was addressed by me by another question a few days ago.This is the original question and my answer.
Basically the issue here is that you need to install Python to use Jekyll on Windows because the code highlighter Pygments is written in Python, hence requires Python to function. Pygments is alsothe default code highlighter currently. In the future versions of Jekyll will use the Rouge highlighter, which is written completely in Ruby. This issue is tracked on GitHub.
To solve your current problem, you just need to install Python 2.x, which the official linked guide from the Jekyll documentation provides very clear instructions there. You will also need to install pip. I have also included alternatives in the other SO answer I have given, so I will just provide you the link to it to reduce duplicate information and copy-paste.
Once you have Python 2.x and pip set up, and install pygments, your Jekyll install should be up and running with the site template!
Regarding the Gemfile
A summary of what a Gemfile is: A file that lists all the required Ruby gems for a particular program. For example, you wrote a ruby program that depends on 10 other gems, rather than ask the user of your new gem to go download the previous 10 gems, and then later wrestle with outdated gem issues, a Gemfile is used to keep track of what gems are needed and version. The Gemfile is used by Bundler, which is also a gem that automatically keeps track of what gems you need. In the case of Jekyll, you can use a Gemfile to dictate what you want added into your Jekyll install or removed. This is used by GitHub to keep local versions of Jekyll and other gems updated with the version used by Github Pages.
As for that notification, all you would need to do to avoid polling for changes is:
Open notepad or text editor of choice.
Add this line: gem 'wdm','>=0.1.0' if Gem.win_platform, just that line of text. You can later add gems by typing in gem 'nameOfGem in a separate line.
Save the file as Gemfile in your Jekyll site's folder. Notice that there is not .txt extension, which you can create a file with no extension in notepad by choosing 'All Files' instead of '.txt' under 'Save As'. Or, you could just edit the file extension to remove the .txt.
Install bundler by executing gem install bundler.
Run bundle install to update the gems. If you're using GitHub, add the Gemfile and the newly generated Gemfile.lock into git.
I have something wrong with my jekyll installation. After typing however jekyll command in terminal, it outputs following:
/usr/lib/ruby/vendor_ruby/jekyll/converters/sass.rb:6:in
<module:Converters>': uninitialized constant Jekyll::Converters::Scss (NameError)
from /usr/lib/ruby/vendor_ruby/jekyll/converters/sass.rb:5:in ...'
Anyone knows what's wrong? I have no idea. Thanks
You can try to gem update or bundle update. This seems to be an old bug.
I had this problem with jekyll on Ubuntu 14.10. It's been fixed in Debian, and reported as a bug in Ubuntu. You can manually apply the same fix, it's just one line (see patch) that needs to be added to a file:
Open /usr/lib/ruby/vendor_ruby/jekyll/converters/sass.rb
Add require 'jekyll/converters/scss' at the top, just after require 'jekyll/utils'
Also make sure that the package ruby-mercenary is installed (sudo apt-get ruby-mercenary), because of another bug.
Then Jekyll will work. Alternatively, use Rubygems: gem install jekyll.