user1509284
user1509284

Reputation: 1

Jekyll not processing plugins on server

Jekyll is processing my _plugins folder fine on my local machine (OS X 10.7.4, ruby 1.9.3), but it's not processing them on the server (Ubuntu 12.04, ruby 1.9.3). Both have the same version of Jekyll installed (0.11.2).

I'm trying to use the generate_sitemap plugin, here.

I'm deploying via git and the post-receive hook, which looks like this:

#!/bin/bash -l

GIT_REPO=/my_repo.git
TMP_GIT_CLONE=/my_temp_folder/
PUBLIC_WWW=/my_public_folder/

git clone $GIT_REPO $TMP_GIT_CLONE
jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit

I am seeing this error when I deploy:

remote: /home/ed/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.

But, from what I've read, that's a Maruku warning and has nothing to do with the plugins.

Anybody have any ideas about what I can try to figure this out? I'm at a bit of a loss.

Upvotes: 0

Views: 1111

Answers (3)

pearswj
pearswj

Reputation: 66

I had the same problem with Jekyll not loading plugins when called from the post-receive hook.

As is mentioned in the comments above, changing the current working directory to $TMP_GIT_CLONE does the trick.

You don't have to change anything in _config.yml.

#!/bin/bash -l

GIT_REPO=/my_repo.git
TMP_GIT_CLONE=/my_temp_folder/
PUBLIC_WWW=/my_public_folder/

git clone $GIT_REPO $TMP_GIT_CLONE
cd $TMP_GIT_CLONE                             # move to the temp dir
jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
cd                                            # move back to allow deletion
rm -Rf $TMP_GIT_CLONE
exit

This is a real head-scratcher seeing as executing the original post-receive hook manually as the git user works just fine... Anyway, Jekyll is now loading plugins on my server and hopefully making this a proper answer will help others to find this solution.

Upvotes: 2

alswl
alswl

Reputation: 1405

Lately, I start to build https://github.com/alswl/code-standards-jekyll with jekyll. I write two plugins in _plugins, and I found it was hard to debug.

At first, I use puts "balabala" to debug, it seems work.But once I met problem that didn't generate anything in the _site folder, and there was no 'balabala' in the console, I was panic.

After I read the jekyll source, I try to set auto=false in _config.yml, running jekyll will produce some debug trace stack error. Thank godness.

So, ues auto=false will help you to debug plugins.

Upvotes: 2

tamirko
tamirko

Reputation: 529

It's very hard to debug with Jekyll, but it's a great tool !!!

I assume you have more than one plugin in your _plugins folder.

So maybe one or some of your plugins , cause the problem.

If I'm right, you can do the following :

  • Kill your Jekyll
  • Create a backup of your plugins in another location (not in _plugins folder).
  • Leave just one plugin in your _plugins folder and start Jekyll.
  • If it works , copy another plugin to the _plugins folder, until you find the one which fails the Jekyll.

When you find it, you can add debug printouts to the problematic plugin (that's what I did).

Something like : puts "before .... "

I have built the http://www.cloudifysource.org/ only with Jekyll and you can find and use lots of our useful examples in our GitHub repo : https://github.com/CloudifySource/cloudifysource.github.com

Upvotes: 6

Related Questions