Octopress can't build with Code Block - jekyll

I try to do something like this Octopress code block
But I can't make it work.
It always shows the following error. My machine is Windows 7.
$ rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from d:/MyProject/Git/octopress/_config.yml
Building site: source -> public
Liquid Exception: No such file or directory - python c:/Ruby193/lib/ruby/gems/1.
9.1/gems/pygments.rb-0.3.7/lib/pygments/mentos.py in 2013-01-06-octopress.markdo
wn
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162:in
`spawn'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162:in
`spawn'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:307:in
`popen4'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:41:i
n `start'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:203:
in `mentos'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:192:
in `highlight'
d:/MyProject/Git/octopress/plugins/pygments_code.rb:24:in `pygments'
d:/MyProject/Git/octopress/plugins/pygments_code.rb:14:in `highlight'
d:/MyProject/Git/octopress/plugins/code_block.rb:82:in `render'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:94:in `bloc
k in render_all'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `coll
ect'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `rend
er_all'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:82:in `rend
er'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:124:in `
render'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/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'
d:/MyProject/Git/octopress/plugins/post_filters.rb:167:in `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:264:in `<top (requi
red)>'
c:/Ruby193/bin/jekyll:23:in `load'
c:/Ruby193/bin/jekyll:23:in `<main>'
Build Failed
Without code block, it works fine. I have installed python 2.73 and 3.3 for windows but not luck.
I have tried pygments 0.3.7 and rubypython 0.6.3 as well. It doesn't work.
The funny thing is I google hours and hours,and I don't see anyone else have the same problem.
I must miss something very simple.

I finally fixed the problem. It turns out the PATH for Python wasn't set correctly.
It seems like Python doesn't set up the path automatically.
All I have to do is to add the path.

Related

ESP32 cannot upload code write_flash error

I'm getting this error on Arduino(1.8.9).
usage: esptool write_flash [-h] [--erase-all]
[--flash_freq {keep,40m,26m,20m,80m}]
[--flash_mode {keep,qio,qout,dio,dout}]
[--flash_size FLASH_SIZE]
[--spi-connection SPI_CONNECTION] [--no-progress]
[--verify] [--compress | --no-compress]
<address> <filename> [<address> <filename> ...]
esptool write_flash: error: argument <address>
<filename>: [Errno 2] No such file or directory:'/home/USER/.arduino15/packages/esp32/hardware/esp32/1.0.2/tools/partitions/boot_app0.bin'
esptool write_flash: error: argument <address> <filename>: [Errno 2] No such file or directory: '/home/USER/.arduino15/packages/esp32/hardware/esp32/1.0.2/tools/partitions/boot_app0.bin'
Although boot_app0.bin file is present:
image link
To fix this problem you can try to edit the platform.txt file which you can find in your esp package directory.
So, you need to replace inner section with code written below:
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern={recipe.hooks.linking.prelink.1.pattern} & "{compiler.path}{compiler.c.elf.cmd}" {build.exception_flags} -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" & {recipe.objcopy.hex.1.pattern}
The key thing here is "{recipe.hooks.linking.prelink.1.pattern} &" at start and "& {recipe.objcopy.hex.1.pattern}" at the end. The text between is the part of the platform.txt file, that you dont need to change.
The above is true for OS Windows. In OS Linux set {recipe.hooks.linking.prelink.1.pattern} ;" and "; {recipe.objcopy.hex.1.pattern}".
Its solve my problem for ESP8266, I hope its will be helpful for you too.
Reference link https://www.eclipse.org/forums/index.php/t/1095090/
if you are using esptool. Make sure you actually download the files from github using the download button instead of using the save as option when u right click on the file name.

Erlang Config File Oddness

I have got the following .erlang file in my home directory (Ubuntu):
io:format("executing user profile in home/user/.erlang\n",[]).
code:add_pathz("/media/user/Disk2/Cloud/Workspace/Erlang").
code:add_pathz("/media/user/Disk2/Cloud/Workspace/Erlang/code").
shell_default:cd("/media/user/Disk2/Cloud/Workspace/Erlang").
io:format(".erlang rc finished\n",[]).
I can see that the file is run when I start the Erlang shell in the terminal. What is more, the shell_default:cd-command works fine. However, the code:add_pathz-commands do not. When I try to run anything in the code-directory, I get an "undefined function"-error. Besides, when I list the paths with "code:get_path().", I get:
[".","/usr/lib/erlang/lib/kernel-2.16.4/ebin",
"/usr/lib/erlang/lib/stdlib-1.19.4/ebin",
"/usr/lib/erlang/lib/xmerl-1.3.5/ebin",
"/usr/lib/erlang/lib/wx-1.1.1",
"/usr/lib/erlang/lib/webtool-0.8.9.2/ebin",
"/usr/lib/erlang/lib/typer-0.9.5/ebin",
"/usr/lib/erlang/lib/tv-2.1.4.10/ebin",
"/usr/lib/erlang/lib/tools-2.6.13/ebin",
"/usr/lib/erlang/lib/toolbar-1.4.2.3/ebin",
"/usr/lib/erlang/lib/test_server-3.6.4/ebin",
"/usr/lib/erlang/lib/syntax_tools-1.6.12/ebin",
"/usr/lib/erlang/lib/ssl-5.3.2/ebin",
"/usr/lib/erlang/lib/ssh-3.0/ebin",
"/usr/lib/erlang/lib/snmp-4.25/ebin",
"/usr/lib/erlang/lib/sasl-2.3.4/ebin",
"/usr/lib/erlang/lib/runtime_tools-1.8.13/ebin",
"/usr/lib/erlang/lib/reltool-0.6.4.1/ebin",
"/usr/lib/erlang/lib/public_key-0.21/ebin",
"/usr/lib/erlang/lib/pman-2.7.1.4/ebin",
"/usr/lib/erlang/lib/percept-0.8.8.2/ebin",
"/usr/lib/erlang/lib/parsetools-2.0.10/ebin",
"/usr/lib/erlang/lib/otp_mibs-1.0.8/ebin",
"/usr/lib/erlang/lib/os_mon-2.2.14/ebin",
"/usr/lib/erlang/lib/orber-3.6.26.1/ebin",
"/usr/lib/erlang/lib/odbc-2.10.18/ebin",
"/usr/lib/erlang/lib/observer-1.3.1.2/ebin",
"/usr/lib/erlang/lib/mnesia-4.11/ebin",
[...]|...]
Why isn't "code:add_pathz" working? Thanks.
Erlang R16B03
Eshell V5.10.4
Ubuntu LTS 14.04
The path above works. The fault was with .beam-files in the code-directory. Recompiling made them accessible from outside the "code"-directory.

How do I tell Jekyll/Maruku which post has the Markdown syntax error?

How do I tell Jekyll/Maruku to tell me which file has my Mardown syntax error?
The build warning only tells me so much:
$ jekyll --safe
Configuration from /homne/me/_config.yml
Building site: /homne/me -> /homne/me/_site
___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Could not find ref_id = "md_entityhellip" for md_link([md_entity("hellip")],"md_entityhellip")
| Available refs are ["png", "2", "3", "4", "5", "6"]
+---------------------------------------------------------------------------
!/home/eoin/.rvm/gems/ruby-1.9.3-p385/gems/maruku-0.6.1/lib/maruku/errors_management.rb:49:in `maruku_error'
!/home/eoin/.rvm/gems/ruby-1.9.3-p385/gems/maruku-0.6.1/lib/maruku/output/to_html.rb:716:in `to_html_link'
!/home/eoin/.rvm/gems/ruby-1.9.3-p385/gems/maruku-0.6.1/lib/maruku/output/to_html.rb:970:in `block in array_to_html'
!/home/eoin/.rvm/gems/ruby-1.9.3-p385/gems/maruku-0.6.1/lib/maruku/output/to_html.rb:961:in `each'
!/home/eoin/.rvm/gems/ruby-1.9.3-p385/gems/maruku-0.6.1/lib/maruku/output/to_html.rb:961:in `array_to_html'
\___________________________________________________________________________
Not creating a link for ref_id = "md_entityhellip".Successfully generated site: /homne/me -> /homne/me/_site
The next version of Jekyll will have better error reporting with MaRuKu and include the path to the file that caused the error.
The current master branch on GitHub should be stable enough that you could use it for testing purposes. Feedback would be welcome if you do decide to test it out. Thanks!

Vanilla MySQL access from Ruby 1.9 on Snow Leopard

I am running Ruby 1.9 (ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10]) on Slow Leopard (installed via MacPorts).
I then installed the Ruby MySQL client library via MacPorts:
install rb19-mysql
Trying to use it I get the following error:
db.rb:4:in `initialize': wrong number of arguments(4 for 0) (ArgumentError)
from db.rb:4:in `new'
from db.rb:4:in `'
My code:
require 'mysql'
require 'pp'
dbh = Mysql.new("localhost", "testuser", "testpass", "test")
puts "Server version: " + dbh.get_server_info
It seems like I am missing something very basic here.
Did I install the right client library?
I am using it correctly?
Am I missing some other dependencies?
Would appreciate if someone could point me in the right direction.
Thanks!
What you're looking for is:
dbh = Mysql.real_connect("localhost", "testuser", "testpass", "test")
I have never written a line of Ruby in my life so maybe I'm going to embarrass myself, but don't you have to initialize Mysql first? I'm quite sure the fact that the function expects 0 parameters means it doesn't exist yet.
In the test file of the package you mention (you got me curious), I see the following line:
assert_nothing_raised{#m = Mysql.init}
your syntax seems to be correct, however. From the same test file
assert_nothing_raised{#m = Mysql.new(#host, #user, #pass, #db, #port, #sock, #flag)}
I would assume you need to do a Mysql.init() first.
If I'm wrong, let me know and I'll remove the answer.
Your code looks solid to me; it matches the examples given on the rb19-mysql homepage very well.
my = Mysql.new(hostname, username, password, databasename)
st = my.prepare("insert into tblname (col1,col2,col3) values (?,?,?)")
st.execute("abc",123,Time.now)
st.prepare("select col1,col2,col3 from tblname")
st.execute
st.fetch # => ["abc", 123, #<Mysql::Time:2005-07-24 23:52:55>]
st.close
Which would seem to indicate that there's probably something not quite right with the port install. There were all kinds of issues with MacPorts not working properly after snow leopard upgrades - are you falling victim to this? I had to rebuild all my ports before they worked properly.
Also (and I know this is like religion to some people), you might want to consider ditching the MacPort version and just grab the MySql gem. For whatever reason, using the gems has been a far more pleasurable experience for me.
Hope that helps - good luck!

Problem with conflict between mysql and math.h

The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library.
I have been over this for two days and I still can't figure it out.
Has this ever happened to anyone?
This is the output from the compiler
C:\mingw\bin\mingw32-make.exe all
'Building file: ../src/interfaz/ventanaconf.cpp'
'Invoking: GCC C++ Compiler'
C:\mingw\bin\mingw32-g++.exe -mms-bitfields -I"c:\dev-cpp\gtkmm\include\gtkmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\gtkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\glibmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\glibmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\gdkmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\gdkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\pangomm-1.4"
-I"c:\dev-cpp\gtkmm\include\atkmm-1.6" -I"c:\dev-cpp\gtkmm\include\sigc++-2.0"
-I"c:\dev-cpp\gtkmm\lib\sigc++-2.0\include" -I"c:\dev-cpp\gtkmm\include\cairomm-1.0"
-I"c:\gtk\include\gtk-2.0"
-I"c:\gtk\include\glib-2.0"
-I"c:\gtk\lib\glib-2.0\include"
-I"c:\gtk\lib\gtk-2.0\include"
-I"c:\gtk\include\pango-1.0"
-I"c:\gtk\include\cairo"
-I"c:\gtk\include\freetype2"
-I"c:\gtk\include"
-I"c:\gtk\include\atk-1.0"
-I"c:\Archivos de programa\MySQL\MySQL Server 5.0\include"
-O0 -g3 -w -c -fmessage-length=0 -MMD -MP -MF"src/interfaz/ventanaconf.d"
-MT"src/interfaz/ventanaconf.d"
-o"src/interfaz/ventanaconf.o" "../src/interfaz/ventanaconf.cpp"
In file included from c:/Archivos de programa/MySQL/MySQL Server 5.0/include/my_global.h:73,
from ../src/interfaz/../gestiondb/gestordb.h:6,
from ../src/interfaz/../gestiondb/operacionesdb.h:5,
from ../src/interfaz/ventanamodulos.h:20,
from ../src/interfaz/ventanaconf.h:27,
from ../src/interfaz/ventanaconf.cpp:1:
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h: **In function `double rint(double)':
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h:228: error: redefinition of `double rint(double)'
C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:620: **error: `double rint(double)' previously defined here**
C:\mingw\bin\mingw32-make.exe: *** [src/interfaz/ventanaconf.o] Error 1**
Thanks in advance!!!
This thread in the mysql support area seems to indicate that they've taken the definition of rint() out of their config_win.h file as of April this year (even though the patch was proposed in 2006). Are you using a version of the MySQL source newer than that?
The problem was about an included library, which linux simply ignores, but windows want out. There is no problem letting it out in linux neither...
Somedays i feel SOOOOOOOOOOOOOOOOOOOOOOO STUPID:..
In line 228 of c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h you should find a declaration/definition of function named "rint". In line 620 of C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h you should find another definition of a function with the same name (which probably even does the same).
To solve the problem you will have to delete/outcomment/undefine one of these definitions.
Be prepared to get a similar problem when linking, if you also link two libraries with the same function.