Error when run jekyll server on windows 7 - ruby

I'm trying run Jekyll server in my local machine, so when I run jekyll server in terminal, returning fallowing message:
$ jekyll serve
Configuration file: C:/xxx/Site/_config.yml
Source: C:/xxx/Site
Destination: C:/xxx/Site/_site
Generating...
c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/posix-spawn-0.3.11/lib/posix/spawn.rb:164: warning: cannot close fd before spawn
'which' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.
Liquid Exception: No such file or directory - python c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/pygments.rb-0.6.0/lib/pygments/mentos.py in _posts/2015-06-02-welcome-to-j
ekyll.markdown
done.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for 'C:/xxx/Site'
Configuration file: C:/xxx/Site/_config.yml
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
Cause I trying enter http://127.0.0.1:4000/, is not happen, no error, no 404, only a empty page.
Where is problem?

Python does not appear to be installed, which is why you get a liquid exception when trying to use the code highlighter Pygments.
According to this tutorial, which is the suggested tutorial written by Julian Thilo on the Jekyll documentation, you need Python 2.7.x at time of writing. Here is a summary of what you need to do to get the Jekyll install and server up and running.
Step 1 : Get Python
Download the latest version of Python 2.7: here
Note: Make sure to add python.exe to Path and select “Entire feature will be installed on local hard drive. This is needed on Windows or else Jekyll will fail to build the website when trying to highlight code with Pygments.
Step 2: Install Pip
It's a Python package manager which you'll use to install Pygments. follow the official documentation for doing this.
Step 3: Get Pygments
Finally, Open up a command line and type in python -m pip install Pygments
Step 4 : Done
Run jekyll serve again.
Optional Step
Since Pygments is the default syntax highlighter, you don't have to explicitly define what highlighter you're using, but if you prefer to, add this line to your _config.yml file: highlighter : pygments
ALTERNATIVE 1: Don't want highlighters
If you won't be using a code highlighter just edit the markdown post you have 2015-06-02-welcome-to-jekyll.markdown and remove the Liquid tags like so:
{% highlight ruby %}
//Ruby code on the template you can ignore
{% endhighlight %}
ALTERNATIVE 2: Rouge, no need for Python
Rouge is a Ruby code highlighter, which while does not require Python and all that dependencies as it is written completely in Ruby (which you already have because Jekyll runs on Ruby). You'll need to edit the _config.yml to use rouge like so: highlighter : rouge, and run gem install rouge in the command line, as mentioned in same tutorial. Note that at time of writing Rouge has lesser language support compared to Pygments. (but still a whole lot)
Here's another tutorial on setting up Jekyll on Windows. And it would be a good idea to follow the excellent tutorial I've previously linked for installing Jekyll on Windows.

Related

Ruby on Rail running apache show index of when accessing the site

I have recently updated to Apache 2.4, and I am using Ruby on Rail to run my application. Following the upgrade, the site shows a content as seen in the image below, and the error on the log file shows this error message. I have tried using the 'Bundle Install' and checked the permission but that hasn't helped. Any advice would be greatly appreciated. Thanks
[ 2022-02-07 07:47:24.5559 8104/7efc89c8f700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /home/adminuser/hroot: An error occured while starting up the preloader.
Error ID: ba7e6074
Error details saved to: /tmp/passenger-error-RA01E9.html
Message from application: libmysqlclient.so.18: cannot open shared object file: No such file or directory - /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/gems/mysql2-0.3.14/lib/mysql2/mysql2.so (LoadError)
PassengerRuby /usr/local/rvm/gems/ruby-2.0.0-p353#hroot/wrappers/ruby
SetEnv GEM_HOME /root/.gem/ruby/1.9.1
This error shows a problem with the shared objects. You probably updated MySQL/MariaDB libraries with Apache and new libraries are incompatible with your mysql2 gem build. The solution is simple:
First, ensure you are using the ruby-2.0.0-p353#hroot RVM environment.
Then, execute the following command:
gem install mysql2 --version 0.3.14
This should rebuild your mysql2 gem for the new MySQL/MariaDB client libraries on your system.
this isn't the answer anyway but another method to run ruby (in my case Windows 10 ; if you use another OS try to find out how to modify inside index.php the ruby starter)
i post here an alternative method to use apache + php +... and ruby
https://stackoverflow.com/a/71733656/5781320

--watch arg is unsupported on Windows

I'm new to jekyll so first I follow this tutorial Jekyll on Windows and setup jekyll 3.3.0.I got an error about the certificate this tutorial SSL CERTIFICATE UPDATES
and by using this cacert.pem certificate solve the problem.
However,when start jekyll server I get:
--watch arg is unsupported on Windows.
If you are on Windows Bash, please see: https://github.com/Microsoft/BashOnWindows/issues/216
I try to solve this problem using Let Jekyll --watch without any luck.
If I use jekyll 3.2.1 every things work okay but the problem with jekyll 3.3.0.
So how to solve this problem ?
Edit
I Solve my problem reading this and comment some code in the build.rb file at C:\tools\ruby23\lib\ruby\gems\2.3.0\gems\jekyll-3.3.0\lib\jekyll\commands
To enable autoregeration and now every things work okay.
def watch(site, options)
#if Utils::Platforms.windows?
# Jekyll.logger.warn "", "--watch arg is unsupported on Windows. "
# Jekyll.logger.warn "", "If you are on Windows Bash, please see: " \
# "https://github.com/Microsoft/BashOnWindows/issues/216"
# else
External.require_with_graceful_fail "jekyll-watch"
watch_method = Jekyll::Watcher.method(:watch)
if watch_method.parameters.size == 1
watch_method.call(
options
)
else
watch_method.call(
options, site
)
# end
end
I think you can just type jekyll serve.
It's windows bash error, Jekyll or Windows will fix it soon, till then you can use jekyll 3.2.1 version.
Here I commit my answer.
I solved the problem by installing Ruby 2.3.3, DevKit-mingw64 and jekyll 3.4.3

cannot execute binary file of golang bootstrap installer

I'm using the instructions in this blog post, which is intended for installing go 1.5 on the Raspberry Pi, to install golang on my Chromebook (which has ChrUbuntu not Chromium installed). The technique recommended in the blog post is to install a Golang 1.4 bootstrap compiler available here and then use that to build golang 1.5 (as you need a version of go installed to build 1.5). I tried this on the Raspberry pi and it worked, but when I ran this command from /go/src on ChrUbuntu
env GO_TEST_TIMEOUT_SCALE=10 GOROOT_BOOTSTRAP=$HOME/go-linux-arm-bootstrap ./all.bash
It gave me this output
env GO_TEST_TIMEOUT_SCALE=10 GOROOT_BOOTSTRAP=$HOME/go-linux-arm-bootstrap ./all.bash
# Building C bootstrap tool.
cmd/dist
./make.bash: line 121: /home/user/go-linux-arm/bootstrap/bin/go cannot execute binary file
Why am I getting this error message (is it because it's not compatible with ChrUbuntu) and how to do what I am trying to do. Thank you in advance.

Error -60005 when install Cocos2d-iPhone v3 RC4

When I try to install Cocos2d-iphone 3.0.0 RC4, I got an error: (run without sudo)
Error -60005 occurred while executing script with privileges.
So, I try to show its package content and use terminal to do: cd ...Cocos2D Installer 3.0.0.app/Contents/MacOS
I try this command: (with sudo)
sudo ./Cocos2D\ Installer\ 3.0.0
It works but I got log with some errors:
[1m>>> Installing Cocos2D-v3.0.0 files (B[m
[1m>>> Installing Cocos2D-v3.0.0 templates (B[m
[4m[1mCocos2D Template Installer (Cocos2D-v3.0.0)(B[m
Error: [31m✖︎(B[m Script cannot be executed as root.
In order for it to work properly, please execute the script again without 'sudo'.
If you want to know more about how to use this script execute '/Users/viethung/Downloads/Cocos2D-v3.0.0/install.sh --help'.
[1m>>> Building/Installing Cocos2D-v3.0.0 documentation, this may take a minute.... (B[m
appledoc version: 2.2 (build 963)
Generation step 4/5 failed: GBDocSetInstallGenerator failed generating output, aborting!
Documentation set was installed, but couldn't reload documentation within Xcode.
Xcode got an error: No documentation set present at specified path.
[1m>>> Cocos2D-v3.0.0 installation complete! (B[m
Are there any way is better than this way?
I have same problem.
I think you installed old cocos2d-iphone and it caused this problem.
You should remove old cocos2d-iphone first. I removed:
~/Library/Developer/Xcode/cocos2d v3.x
And install again. It works for me.
Hope it works for you :)

Jeet Framework: Got an error when trying to run Jeet 2:

Got an error when trying to run Jeet 2:
In CMD:
Compiling Stylus OK!
Saving Compiled Stylus OK!
Live Reload is on and listening!
Compiling SCSS ... Error!
I'm on Windows XP
Is there something with the Ruby installation on Windows?
I followed your tutorial on https://github.com/CorySimmons/jeet#quick-start
If you can type ruby into your Command Prompt and it doesn't return an error then you have Ruby.
You need to install Compass as well: http://compass-style.org/install/
In Windows command prompt you don't use the $ in front of the gem command! You just type gem update system, instead of $ gem update system.

Resources