Jekyll Serve is not serving in localhost - terminal

I've been using jekyll for a month or so and had no problems until today. I went to run jekyll in the terminal and was prompted with this:
Configuration file: /Users/jamiefitzhenry/desktop/casa/_config.yml
jekyll 2.5.3 | Error: Address already in use - bind(2)
I seemed to fix this by finding the PID and killing it, however when I run jekyll again I get this:
Configuration file: /Users/jamiefitzhenry/desktop/casa/_config.yml
Server address: http://127.0.0.1:3000/
Server running... press ctrl-c to stop.
When I put http://127.0.0.1:3000/ into my browser I only get the html of the page however nothing else is updating. When I go into my text editor (Espresso) and save changes nothing happens. This is my config.yml
# Build settings
markdown: kramdown
permalink: pretty
port: 3000
sass:
sass_dir: assets/css
style: :nested
This usually happens whenever I start to run jekyll, however as soon as I save the index.html the whole site updates in the browser, which is not the case this time.
I'm still very new to running commands in the terminal, however any help would be much appreciated.

Related

Process killed when running npm install during file generation step of production guide (Canvas LMS)

I am trying to set up a canvas lms on an amazon ec2 Ubuntu environment. I've gone so far until the file generation step of the production environment guide. I've been able to successfully follow the steps until this point.
Steps to reproduce:
I was successful in making the asset directories and taking their ownership as directed in this step:
sysadmin#appserver:~$ cd /var/canvas
sysadmin#appserver:/var/canvas$ mkdir -p log tmp/pids public/assets public/stylesheets/compiled
sysadmin#appserver:/var/canvas$ touch Gemfile.lock
sysadmin#appserver:/var/canvas$ sudo chown -R canvasuser config/environment.rb log tmp public/assets \ public/stylesheets/compiled Gemfile.lock config.ru`
After this, I run 'npm install'
It is at this point that after getting some deprecated warnings I get stuck at this line:
canvas-lms#0.0.0 preinstall /home/ubuntu/canvas/script/gem_npm install
running npm install for gems/canvas_i18nliner/package.json
running npm install for gems/selinimum/package.json
Killed [ ..] / extract:lodash: sill gunzTarPerm modified mode [ 'fp/getOr.js', 420, 436 ]'
What I've already tried:
First I thought it was an error with the port 9418/tcp not being open. I opened this port through amazon ec2 security group inbound rules. This did not work. Then I tried opening all the ports 1-65000 to fix this. It still did not work.
Additional notes:
From the looks of it, it does not looks like a port issue because the script is able to fetch data in the previous steps. Also from the progress bar it can be seen that the extract is failing only when the last 2 dots are left as the progress bar is shows like this: [ ..]. I'm guessing this is a .js creation erorr.
The documentation provides a link to fix those issues but the description of the steps to follow are not very elaborate there as I can't understand what exactly i need to do. Can someone please look into this and help me? Any help is much appreciated.
The File Generation section in the production guide says to follow this link to fix .js creation issues. The solution I found in this link was to add the following code to the compile_template function found in lib/handlebars/handlebars.rb file. The directory lib/handlebars does not exist in /lib
def compile_template(source, id, plugin=nil)
require 'execjs'
require 'multi_json'
P.S. I downloaded my installation directly from the git repository so no chance of this being missing for some reason :/

PHP5-FPM refuses to log errors running under Foreman nginx with Heroku buildpack

I have tried absolutely everything for days now, and there is no way I can get PHP to log its errors locally or running on Heroku itself. My exact setup:
VAGRANT BOX: Homestead/laravel (this contains the PHP / Nginx install)
Once the vagrant box is running, I stop the running services (sudo service nginx stop and sudo service php5-fpm stop). The Heroku toolbelt is installed on this box. I am using PHP Version 5.6.0-1+deb.sury.org~trusty+1, but have tried with previous versions (different version of Homestead/Laravel box).
COMPOSER INSTALL: I have the following composer.json file, although I have tried various options including not using my own buildpack but just the default one etc.
{
"extra": {
"heroku": {
"document-root": "webroot",
"index-document": "index.php"
}
},
"repositories": [
{
"type": "git",
"url": "https://github.com/ashleycoker/heroku-buildpack-php"
}
],
"require-dev": {
"heroku/heroku-buildpack-php": "dev-master"
}
}
FOREMAN: I run my own procfile using sudo foreman start -f Procfile.dev shown here:
web: vendor/bin/heroku-php-nginx -v webroot/
Everything works as expected, apart from the error logging for PHP. I am actually running an expressionengine install, and can access PHPinfo fine and see that the error log is set to /tmp/heroku.php-fpm.www.5000.log. log_errors is on, and everything you would expect seems fine in the ini file.
I think I have read / tried every solution on Google to get this to work but to no avail. I have tried changing the ownership of the error_log file, changing its location, changing PHP error log settings including to have E_ALL so everything is logged. I even get the PHP notices on the screen so I know something should be going into the log file.
An important line from heroku-php-nginx that seems important is the fact that it redirects all logs to stderr so that Heroku can pick them up - exactly what I want to happen.
( touch "${logs[#]}"; tail -qF -n 0 "${logs[#]}" | strip_fpm_child_said 1>&2 || true; echo 'tail "${logs[#]}"' >&3; ) 3> $wait_pipe &
However I can not see the logs anywhere!
I just want errors to be logged so that I can go into production with some peace of mind!
Any more info required just ask and I will happily answer ASAP with as much info as I can.
Thanks

Jekyll baseurl and configuration for 'serve'

I succeeded in setting up a Jekyll site, but there is one thing I would like to optimize. In my config file I have the value http://mydomain.com/ as baseurl. Everything is working fine, except that every time I want to use the 'serve' command to have a local development server as a preview for a post that I am currently writing, I have to manually set the baseurl to '/' to make it work. Otherwise the server address would be http://0.0.0.0:4000http://mydomain.com/ and non-working.
Is there an easy workaround for this, or am I doing something wrong?
Thanks.
Just found out, that this command solves my problem.
jekyll serve --baseurl '/'
What do you mean by "manually" ?
jekyll serve --baseurl '/'
Should work (and your terminal will remember the command). Now, if you are using GitHub pages, you don't really need the baseurl anyway.
Base url is the path after the hosts part in the url.
So your local parameters must be :
host: http://mydomain.com/
baseurl: ""

Jekyll not serving site locally

Configuration: OSX 10.9.1, ruby 2.1.1 via RVM
I have created a new Jekyll site via the command jekyll new sitename.
I then enter that directory and issue the command jekyll serve.
I get the following notice:
Configuration file: /Users/George/sitename/_config.yml
Source: /Users/George/sitename
Destination: /Users/George/sitename/_site
Generating... done.
Server address: http://0.0.0.0:4000
Server running... press ctrl-c to stop.
However when attempting to visit http://localhost:4000/ or http://0.0.0.0:4000/ my browser endlessly attempts to load the page.
I have checked and the site was built correctly including an index.html in /Users/George/sitename/_site/.
The _config.yml looks like so:
name: sitename
markdown: maruku
pygments: true
Does anyone know why Jekyll could be failing to serve the site but not throwing any errors?
Edit: If I change the port to 6000 and attempt to serve it then my browser instantly gives a page not found so there must be something interfering with port 4000 however the issue still stands.
It's likely that something else is using port 4000 on your computer. You can find out by running the following command:
sudo lsof -i :4000
As you can run the server on another port, we'll move on to the next issue, setting the baseurl. In your _config.yml you can specify which baseurl to use, this will be the url from which all pages are served, so if you had baseurl: http://myawesomesite.com, Jekyll will expect them to be accessed from that url.
As you're working locally, you have two options:
Set the baseurl to / in your _config.yml:
baseurl: /
Launch Jekyll with the --baseurl flag:
$ jekyll serve -w --baseurl '/'
Additionally, you could specify the port as a flag:
$ jekyll server -w --baseurl '/' --port 4000
If you want further information about what's going on when you run jekyll, you can run the command with the --trace flag:
$ jekyll server -w --trace

Ruby app only works when Passenger is "disabled"

I have deployed a Sinatra application on an Ubuntu server using Apache and Passenger. Through some trial and error, I realize the app only works when the passenger module is disabled.
$ a2dismod passenger
After an Apache restart, the app runs as expected.
If I re-enable the module...
$ a2enmod passenger
...I see this warning upon Apache restart:
[warn] module passenger_module is already loaded, skipping
and the app stops working. Apache responds, serving the contents of the vhost's document root, but is not recognized by Passenger.
I'm glad my app works, but I'm not sure how to explain the reversed effect of enabling/disabling the passenger module.
I ran into the same problem: if you follow passenger installing instruction with this version of Apache you may actually tell Apache to load passenger twice.
Before adding the 3 famous lines to your Apache configuration file:
LoadModule passenger_module /usr/…/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.11
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.2-p290/ruby
Check the configuration file apache2.conf for lines like these:
# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
If these lines do exists it means that on start your Apache server will include every *.conf and *.load file from /mods-available to /mods-enabled and than load them.
So if you run in the concerning warning message it means you are loading passenger module twice!
You can take advantage of this Apache feature going to /mods-available, looking for passenger.conf and passenger.load files and edit them instead of apache2.conf.
The ‘LoadModule passenger_module’ line goes into passenger.load, while the other 2 ‘PassengerRoot’ and ‘PassengerRuby’ lines go into passenger.conf.
Then restart your server and you’ll be fine.
More about this issue here: http://www.duccioarmenise.net/ruby-on-rails/warn-module-passenger_module-is-already-loaded/
This most likely means you've specified 'LoadModule passenger_module ...' twice. The first entry is somewhere not in passenger.conf, the second entry is in passenger.conf.

Resources