0

So I'm using Digital Ocean.

I have started fresh for this project, so I have created a droplet, install Debian 7 and Apache 2 (no alterations, just as is).

I am trying to follow this tutorial.

Now I followed it letter for letter, adjusting my vars accordingly.

All seems good and I don't get any errors, even when I push my folder.

However nothing happens after that. My servers IP address is all in entering into my browser, but it's just the default Apache index that gets loaded.

I have triple checked that my server has Ruby, Jekyll and git installed, as does my local environment.

This is my post-receive file (which I have chmod'd as per the tutorial)

#!/bin/bash -l
GIT_REPO=$HOME/repos/portfolio.git
TMP_GIT_CLONE=$HOME/tmp/git/portfolio
PUBLIC_WWW=/var/www

git clone $GIT_REPO $TMP_GIT_CLONE
jekyll build --source $TMP_GIT_CLONE --destination $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit

I have double checked to make sure my repo is in the correct place.

So does anybody have some idea what might be the issue? I have tried everything I can think of, but nothing is working.

Hopefully it's clear I'm quite new to this, so I accept I've no doubt made a rookie error somewhere along the lines.

Edit: Here are my Virtual Host settings:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

An error report after adding a new file and pushing:

remote: /usr/local/rvm/gems/ruby-2.0.0-p576/gems/execjs-2.2.2/lib/execjs/runtimes.rb:51:in ‘autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/execjs-2.2.2/lib/execjs.rb:5:in ‘<module:ExecJS>'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/execjs-2.2.2/lib/execjs.rb:4:in ‘<top (required)>'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/coffee-script-2.3.0/lib/coffee_script.rb:1:in ‘<top (required)>'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/coffee-script-2.3.0/lib/coffee-script.rb:1:in ‘<top (required)>'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/jekyll-coffeescript-1.0.1/lib/jekyll-coffeescript.rb:2:in ‘<top (required)>'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/jekyll-2.4.0/lib/jekyll/deprecator.rb:46:in ‘block in gracefully_require'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/jekyll-2.4.0/lib/jekyll/deprecator.rb:44:in ‘each'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/jekyll-2.4.0/lib/jekyll/deprecator.rb:44:in ‘gracefully_require'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/jekyll-2.4.0/lib/jekyll.rb:141:in ‘<top (required)>'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/rubies/ruby-2.0.0-p576/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ‘require'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/jekyll-2.4.0/bin/jekyll:6:in ‘<top (required)>'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/bin/jekyll:23:in ‘load
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/bin/jekyll:23:in ‘<main>'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/bin/ruby_executable_hooks:15:in ‘eval'
remote:     from /usr/local/rvm/gems/ruby-2.0.0-p576/bin/ruby_executable_hooks:15:in ‘<main>'
JMCharter
  • 21
  • 4
  • Can you tell us your virtual host configuration? If you're seeing the default Apache index, then you may be missing something in the Apache configuration. – gmarintes Oct 22 '14 at 15:16
  • @gmarintes As I said I'm rather new to this, so I assume you mean the settings listed here: /etc/apache2/sites-available/default. If so, this is the settings have been added now :) – JMCharter Oct 22 '14 at 15:30
  • Yes, it is. Check the DocumentRoot line. It needs to point to your site's 'public' directory. – gmarintes Oct 22 '14 at 15:31
  • @gmarintes I've added the file into my post now :) – JMCharter Oct 22 '14 at 15:34
  • Kindly check the contents of the /var/www directory. It should contain your webapp's public directory. I'm guessing it still has the default index.html that Apache has. – gmarintes Oct 22 '14 at 15:37
  • @gmarintes Indeed, it does only contain that default file. But am I not right in thinking that the script from the tutorial I linked should be adding in everything from my jekyll file? – JMCharter Oct 22 '14 at 15:39
  • Did you make it to 'git push droplet master' part? YOu might have skipped something if your files are still not there. – gmarintes Oct 22 '14 at 15:42
  • @gmarintes I did, in fact it didn't even have any errors. I cant think of anything I have missed, ive even restarted and gone through a second time just to make sure. – JMCharter Oct 22 '14 at 15:51
  • Try running the 'post-receive' script on commandline and check if it works. – gmarintes Oct 22 '14 at 15:54
  • How do I run that from the command line? Also, I added an error report I just got after pushing again (after adding a new file) Edit: I also just spotted this: `remote: stdin: is not a tty` – JMCharter Oct 22 '14 at 15:59
  • It seems you need to install execjs. Install it with: gem install execjs – gmarintes Oct 22 '14 at 16:02
  • You can run a script in Linux with 'sh – gmarintes Oct 22 '14 at 16:02
  • @gmarintes I've done that and it installed successfully, but upon pushing again it came up with the same error. Sorry for being a pain, really appreciate your help – JMCharter Oct 22 '14 at 16:07
  • Install NodeJS with this: sudo apt-get install nodejs and try again. – gmarintes Oct 22 '14 at 16:10
  • @gmarintes Huh, odd it says it cant locate the package nodejs – JMCharter Oct 22 '14 at 16:12
  • 1
    "$GIT_REPO$TMP_GIT_CLONE" is that a typo? Shouldn't there be a space between them? Always check the return code after making a call. "if [ $? -ne 0 ] then PANIC" – Andrew C Oct 22 '14 at 16:12
  • @AndrewC Yes thats a typo, it does have a space between it. I fudged it a little pasting it here. Good spot though – JMCharter Oct 22 '14 at 16:14
  • Read thru this post: http://stackoverflow.com/questions/7092107/rails-could-not-find-a-javascript-runtime – gmarintes Oct 22 '14 at 16:16
  • @gmarintes Thank you! All solved. I had a few minor bugs to sort in some of my jekyll pages as well, but they became very clear after this. Very much appreciated :D – JMCharter Oct 22 '14 at 19:16

0 Answers0