octopress / linkblog

Adds link blogging features, along with some other niceties, to any Jekyll site.
MIT License
20 stars 12 forks source link

Odd issue when including linkblog on Ubuntu #3

Closed chauncey-garrett closed 9 years ago

chauncey-garrett commented 9 years ago

I am able to successfully build my site on OS X but when I deploy (via a git checkout and jekyll build) my site on my Ubuntu server, I receive the following error related to linkblog:

       /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/octopress-linkblog-2.0.1/lib/octopress-linkblog.rb:42:in `add_post_vars': undefined method `titlecase!' for nil:NilClass (NoMethodError)
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/octopress-linkblog-2.0.1/lib/octopress-linkblog.rb:36:in `post_init'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/octopress-hooks-2.6.0/lib/octopress-hooks.rb:374:in `block in post_init'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/octopress-hooks-2.6.0/lib/octopress-hooks.rb:373:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/octopress-hooks-2.6.0/lib/octopress-hooks.rb:373:in `post_init'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/octopress-hooks-2.6.0/lib/octopress-hooks.rb:325:in `initialize'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:220:in `new'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:220:in `block in read_content'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:219:in `map'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:219:in `read_content'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:195:in `read_posts'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:167:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:176:in `block in read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:176:in `block in read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:176:in `block in read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:176:in `block in read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:176:in `block in read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:176:in `block in read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:176:in `block in read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:176:in `block in read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:172:in `read_directories'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:151:in `read'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/octopress-hooks-2.6.0/lib/octopress-hooks.rb:181:in `read'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:49:in `process'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/command.rb:28:in `process_site'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:56:in `build'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:34:in `process'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/bin/jekyll:23:in `load'
       from /var/www/chauncey.io/tmp/build-142913007730464/vendor/bundle/ruby/2.1.0/bin/jekyll:23:in `<main>'

At first glance, I thought that perhaps the titlecase gem wasn't included in my Gemfile but I checked Gemfile.lock and it is. Also noticed that there is a require 'titlecase' statement at the beginning of the Ruby script, so that's good.

I checked that I'm using the same ruby version on both machines (v2.1.1) and I am thanks to rbenv and .ruby-version.

Not sure why I'm getting the error on my server but not on my mac. Any ideas?

imathis commented 9 years ago

I don't want to point the finger, but If the gem is installed and it isn't being made available, it seems like this is something to do with your RubyGems setup, not this plugin. Perhaps you can try running a simple ruby script that requires titlecase and uses it.

require 'titlecase'

puts "this is a string".titlecase!

$ bundle exec ruby titlecase-test.rb

chauncey-garrett commented 9 years ago

I don't want to point the finger

You're probably right. I'll close the issue for now and reopen if needed.

Also, thanks for the tip: it gave me an idea about where the underlying issue might be. :+1:

imathis commented 9 years ago

You're welcome. Good luck!