ERROR Liquid Exception: No such file or directory - /dev/null #716

Closed
leiming opened this Issue Dec 28, 2012 · 5 comments

Comments

Projects
None yet
5 participants

leiming commented Dec 28, 2012

I install jekyll and Pygments with rubyinstaller and Python2.7 . Because of my blog written in Chinese language, I modified include.rb as

# source = File.read(@file)
source = File.read(@file, :encoding => 'utf-8')

and convertible.rb as:

# self.content = File.read(File.join(base, name))
self.content = File.read(File.join(base, name), :encoding => 'utf-8')

Start the server as

set LC_ALL=en_US.UTF-8
set LANG=en_US.UTF-8
jekyll --server

The Chinese language is well, *While just only adding highligh codes * such as

{% highlight bash %}
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs npm
{% endhighlight %}

Jekyll CANNOT start up:

I:\GitHub\leiming.github.com>jekyll --server
Configuration from I:/GitHub/leiming.github.com/_config.yml
Auto-regenerating enabled: I:/GitHub/leiming.github.com -> I:/GitHub/leiming.git
hub.com/_site
[2012-12-29 02:12:13] regeneration: 53 files changed
Liquid Exception: No such file or directory - /dev/null in 2012-08-24-jslint-vim
.md
C:/Ruby193/lib/ruby/1.9.1/logger.rb:599:in `initialize'
C:/Ruby193/lib/ruby/1.9.1/logger.rb:599:in `open'
C:/Ruby193/lib/ruby/1.9.1/logger.rb:599:in `create_logfile'
C:/Ruby193/lib/ruby/1.9.1/logger.rb:594:in `open_logfile'
C:/Ruby193/lib/ruby/1.9.1/logger.rb:549:in `initialize'
C:/Ruby193/lib/ruby/1.9.1/logger.rb:314:in `new'
C:/Ruby193/lib/ruby/1.9.1/logger.rb:314:in `initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.3/lib/pygments/popen.rb:28:i
n `new'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.3/lib/pygments/popen.rb:28:i
n `rescue in start'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.3/lib/pygments/popen.rb:23:i
n `start'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.3/lib/pygments/popen.rb:197:
in `mentos'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.3/lib/pygments/popen.rb:186:
in `highlight'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/tags/highlight.rb:5
4:in `render_pygments'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/tags/highlight.rb:4
4:in `render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.4.1/lib/liquid/block.rb:94:in `bloc
k in render_all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.4.1/lib/liquid/block.rb:92:in `coll
ect'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.4.1/lib/liquid/block.rb:92:in `rend
er_all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.4.1/lib/liquid/block.rb:82:in `rend
er'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.4.1/lib/liquid/template.rb:124:in `
render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.4.1/lib/liquid/template.rb:132:in `
render!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/convertible.rb:79:i
n `do_layout'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/post.rb:195:in `ren
der'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:200:in `blo
ck in render'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:199:in `eac
h'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:199:in `ren
der'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:41:in `proc
ess'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/bin/jekyll:253:in `block in <t
op (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r.rb:580:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r.rb:580:in `block in notify_observers'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r.rb:579:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r.rb:579:in `notify_observers'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r.rb:334:in `block in initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r/scanner.rb:224:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r/scanner.rb:224:in `notify'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r/scanner.rb:102:in `run_once'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r/scanner.rb:150:in `run_loop'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/directory_watcher-1.4.1/lib/directory_watche
r/scanner.rb:45:in `block in start'
Build Failed

pygmentize.exe is in PATH.
My jekyll URL is leiming.github,com and functioning.
Local server worked well before reinstalling Windows 7.

Help me, please!

Owner

parkr commented Dec 29, 2012

Liquid Exception: No such file or directory - /dev/null looks like it's an issue with logger.rb, as it's trying to dump something into /dev/null which does not exist on Windows systems. It needs to be dumped to NUL instead. Don't think this is an issue with Jekyll, though.

Member

ixti commented Dec 29, 2012

This is an issue with pygments.rb:

# ...
is_windows = RUBY_PLATFORM =~ /mswin|mingw/
# ...
@log = Logger.new(is_windows ? 'NUL:' : '/dev/null')
#...

You can easily workaround it by adding MENTOS_LOG environment variable, like so:

I:\GitHub\leiming.github.com>MENTOS_LOG=NUL jekyll --server

However, please be so kind, report an issue to pygments.rb, as it seems like RUBY_PLATFORM on Windows7 is not matching /mswin|mingw/ pattern.

PS: This issue related to pygments.rb and might be closed.

Member

ixti commented Dec 29, 2012

I must correct myself. This problem was fixed in pygments.rb 0.3.4

So just update pygments.rb version.

parkr closed this Dec 29, 2012

leiming commented Dec 30, 2012

Thanks, ixti. I have updated pygments version and now it works well!

H:\github\38017032.github.io>jekyll serve
Configuration file: none
Source: H:/github/38017032.github.io
Destination: H:/github/38017032.github.io/_site
Generating...
F:/ruby/Ruby21-x64/lib/ruby/gems/2.1.0/gems/posix-spawn-0.3.9/lib/posix/spawn.rb
:164: warning: cannot close fd before spawn
'which' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Liquid Exception: undefined method []' for nil:NilClass in myblog/_posts/2014 -11-14-welcome-to-jekyll.markdown jekyll 2.5.1 | Error: undefined method[]' for nil:NilClass

I don't know the reason.

jekyllbot locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.