EzDevInfo.com

jekyll

Jekyll is a blog-aware, static site generator in Ruby Jekyll • Simple, blog-aware, static sites

TCPServer Error: Address already in use - bind(2)

Jekyll was working fine for me few weeks back but now all of a sudden it gives me the following error:

TCPServer Error: Address already in use - bind(2)
INFO  WEBrick::HTTPServer#start: pid=7300 port=4000

 % lsof -i :4000
 <fetches nothing>

Even though nothing is running on the port. Below are the details:

 % jekyll --version
Jekyll 0.11.2
 % where jekyll
/home/bhaarat/.rvm/gems/ruby-1.9.2-p290/bin/jekyll
/usr/bin/jekyll
 % ruby --version
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
 % rvm --version
rvm 1.10.0 

Here is the output

 % jekyll --server
Configuration from /home/bhaarat/blog/omnipresent.github.com/_config.yml
Auto-regenerating enabled: /home/bhaarat/blog/omnipresent.github.com -> /home/bhaarat/blog/omnipresent.github.com/_site
[2012-04-21 13:46:40] regeneration: 38 files changed
[2012-04-21 13:46:40] INFO  WEBrick 1.3.1
[2012-04-21 13:46:40] INFO  ruby 1.9.2 (2011-07-09) [i686-linux]
[2012-04-21 13:46:40] WARN  TCPServer Error: Address already in use - bind(2)
[2012-04-21 13:46:40] INFO  WEBrick::HTTPServer#start: pid=7382 port=4000

I know the address isn't in use and jekyll is probably breaking for some other reason but throwing that error. What are my options? I've tried re-installing as well.


Source: (StackOverflow)

Error Installing Jekyll - Native Extension Build

I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link. I think it's an update to Ruby, but RVM is having trouble installing alternate versions of ruby as well.

Heres the full post:

$ sudo gem install jekyll    

ERROR:  Error installing jekyll:
ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out

Does this mean I need to update the version of ruby I'm using via rvm?


Source: (StackOverflow)

Advertisements

What is the difference between 0.0.0.0, 127.0.0.1 and localhost?

I am using Jekyll and Vagrant on my mac. I found that Jekyll server will bind to 0.0.0.0:4000 instead of 127.0.0.1:4000. Also gem server will bind to this address by default. I can still visit it via http://localhost:port. But for Jekyll, it seems that the default setting (e.g. 0.0.0.0:4000) requires Internet access. I cannot run Jekyll server without Internet. Is it a small bug?

I also use Vagrant. I have set port forwarding(8080 => 4000) in Vagrantfile, since I install Jekyll in Vagrant virtual machine and test it under Macintosh. If I use the default setting (0.0.0.0:4000), it works. I can visit it from my safari with http://localhost:8080. But if there is not internet, I cannot bind to 0.0.0.0:4000. I use jekyll server -H 127.0.0.1 to bind service to 127.0.0.1:4000 instead, then I cannot visit it via http://localhost:8080.

Can anyone explain the difference between 0.0.0.0, 127.0.0.1 and localhost? And can anyone explain why the difference will cause this problem?


Source: (StackOverflow)

Sorted navigation menu with Jekyll and Liquid

I'm constructing a static site (no blog) with Jekyll/Liquid. I want it to have an auto-generated navigation menu that lists all existing pages and highlight the current page. The items should be added to the menu in a particular order. Therefore, I define a weight property in the pages' YAML:

---
layout : default
title  : Some title
weight : 5
---

The navigation menu is constructed as follows:

<ul>
  {% for p in site.pages | sort:weight %}
    <li>
      <a {% if p.url == page.url %}class="active"{% endif %} rel='nofollow' href="{{ p.url }}">
        {{ p.title }}
      </a>
    </li>
  {% endfor %}
</ul>

This creates links to all existing pages, but they're unsorted, the sort filter seems to be ignored. Obviously, I'm doing something wrong, but I can't figure out what.


Source: (StackOverflow)

Github - Jekyll - Old pages redirection - best approach

I have blog on github pages - jekyll

What is the best way to solve url strategy migration?

I found the best practice in common is create htaccess like so

Redirect 301 /programovani/2010/04/git-co-to-je-a-co-s-tim/ /2010/04/05/git-co-to-je-a-co-s-tim.html

But it does not seems to work with Github. Another solution i found is create rake task, which will generate redirection pages. But since it's an html, it's not able to send 301 head, so SE crawlers will not recognize it as an redirection.


Source: (StackOverflow)

Table not render when use Redcarpet in Jekyll GitHub Pages?

As of maruku engine (the default), writing table like

surround text, etc.

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |

surround text...

would render correctly.

But when I switch to redcarpet (add markdown: redcarpet into _config.yml), the table no longer rendered, both localhost and on GitHub Pages.

Did I do something wrong?


Source: (StackOverflow)

Upload images to GitHub from the browser

I am using GitHub Pages, Jekyll, and Prose to manage a Website. Everything works fine, besides I cannot find a way to upload images. The Prose image uploader is not working probably as discussed in various tickets (for instance here).

Since the Website is for a friend without any git or command line experience, I am looking for another option to upload images easily from the browser to GitHub. Are there any other options like this? I don't want to host the image on an external site.


Source: (StackOverflow)

How does Jekyll date formatting work?

I'm using Jekyll to generate a simple site.

I want the date field to display in the format 12 September 2011.

I've found, through some creative googling, a bit of date-format manipulation, but nothing that seems to get me the month name. What I have is {{ page.date| date: "%m-%d-%Y" }}, which gets me output as 09-12-2011, but isn't quite what I'm looking for.

Is there any way to get the month as a name in Jekyll?

Or, barring that, is there any documentation for the date attribute?


Source: (StackOverflow)

Jekyll Bootstrap based blog - Expire headers?

I have a Jekyll bootstrap based blog hosted on Github pages.

My problem is: Every time I change something on my web page, I have to forcefully reload the page (CTRL + R) to see the changes.

Jekyll or my browser does not seem to realize that there is a newer version available to send out.

How can I configure Jekyll to better handle this?


Source: (StackOverflow)

An easy way to support tags in a jekyll blog

I am using the standard jekyll installation to maintain a blog, everything is going fine. Except I would really like to tag my posts.

I can tag a post using the YAML front matter, but how do I generate pages for each tag that can will list all posts for a tag?


Source: (StackOverflow)

Using Live Reload with Jekyll

I'm getting started with Jekyll static site generator and I would like to use Live Reload with it. I know Jekyll has a generator and server commands, and Live Reload can run various compilers and custom commands. How do I configure these to work together?


Source: (StackOverflow)

Jekyll on Windows: Pygments not working

I updated to the latest JekyllBuild (1.0.3) before I always used the RC. After updating the parsing of codes (with Pygments) doesn't work anymore. I always get the following error:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162: warning: cannot close fd before spawn
←[31m  Liquid Exception: No such file or directory - /bin/sh in 2012-01-17-test-post.md←[0m

Did anyone also ran into this problem?

I have no clue about ruby, so I can not debug this myself :(


Source: (StackOverflow)

Jekyll - Automatically highlight current tab in menu bar

I am using github to host a static site and Jekyll to generate it.

I have a menu bar (as <ul>) and would like the <li> corresponding to the current page to be assigned a different class for CSS highlighting.

So something like pseudo code:

<li class={(hrefpage==currentpage)?"highlight":"nothighlight"} ...>

Or perhaps even generate the whole <ul> in Jekyll.

How can this be done with minimal changes outside of the offending <ul>?


Source: (StackOverflow)

Local post assets with Jekyll

I was wondering how other people are organising their assets for individual posts when using Jekyll. For example, if a post has an image, do you just dump it in a shared images folder? I don't really like the idea of doing this - it means that an image is completely separated from a post, when I think they should be paired.


Source: (StackOverflow)

Highlight with Jekyll and pygments doesn't works

I want to use pygments with jekyll

In my code I have the following:

{% highlight java %}
NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap
{% endhighlight %}

I generate my site with jekyll --pygments and the html result is:

<div>
  <pre><code class="java">NullPointerException at org.springframework.core.GenericTypeResolver.getTypeVariableMap</code>
  </pre>
</div>

No <span class="n"> or <span class="s2"> or ... and the code is not highlighted

Am I doing something wrong?


Source: (StackOverflow)