cboettig / labnotebook

:notebook: Source code and version history for my online lab notebook
http://www.carlboettiger.info
Creative Commons Zero v1.0 Universal
99 stars 61 forks source link

Building notebook fails #46

Closed goxberry closed 11 years ago

goxberry commented 11 years ago

First, I tried the following setup in RVM:

Ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-linux]

with the following locally installed gems:

activesupport (3.1.9) addressable (2.3.2) builder (3.1.4) bundler (1.2.3) classifier (1.3.3) curb (0.7.18) directory_watcher (1.4.1) faraday (0.8.4) faraday_middleware (0.9.0) fast-stemmer (1.0.1) feedzirra (0.1.3) hashie (1.2.0) i18n (0.6.1) jekyll (0.12.0) json (1.7.6) kramdown (0.13.8) liquid (2.4.1) loofah (1.2.1) maruku (0.6.1) multi_json (1.5.0, 1.2.0) multipart-post (1.1.5) netrc (0.7.7) nokogiri (1.5.6) octokit (1.20.0) pandoc-ruby (0.6.0) posix-spawn (0.3.6) pygments.rb (0.3.7) rake (10.0.3) rdoc (3.12) rubygems-bundler (1.1.0) rvm (1.11.3.5) sax-machine (0.1.0) simple_oauth (0.2.0) syntax (1.0.0) twitter (4.4.2) yajl-ruby (1.1.0)

These gems should be the gems installed when running

gem install jekyll feedzirra nokogiri twitter octokit pandoc-ruby

I got the following error when I built the notebook using Jekyll:

Configuration from " /home/oxberry1/carl_lab_notebook.git/_config.yml /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in raise_if_conflicts': Unable to activate activesupport-3.1.9, because multi_json-1.5.0 conflicts with multi_json (< 1.3, >= 1.0) (Gem::LoadError) from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:inactivate' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:780:in block in activate_dependencies' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:ineach' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in activate_dependencies' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:750:inactivate' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems.rb:212:in rescue in try_activate' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems.rb:209:intry_activate' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in rescue in require' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:inrequire' from /home/oxberry1/carl_lab_notebook.git/_plugins/jekyll-labnotebook-plugins/mendeley_feed.rb:1:in <top (required)>' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/gems/jekyll-0.12.0/lib/jekyll/site.rb:78:inblock (2 levels) in setup' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/gems/jekyll-0.12.0/lib/jekyll/site.rb:77:in each' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/gems/jekyll-0.12.0/lib/jekyll/site.rb:77:inblock in setup' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/gems/jekyll-0.12.0/lib/jekyll/site.rb:76:in each' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/gems/jekyll-0.12.0/lib/jekyll/site.rb:76:insetup' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/gems/jekyll-0.12.0/lib/jekyll/site.rb:31:in initialize' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/gems/jekyll-0.12.0/bin/jekyll:238:innew' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/gems/jekyll-0.12.0/bin/jekyll:238:in <top (required)>' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/bin/jekyll:19:inload' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/bin/jekyll:19:in <main>' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/bin/ruby_noexec_wrapper:14:ineval' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@jekyll_0_12_0/bin/ruby_noexec_wrapper:14:in `

'

So I figured I'd try a second installation in RVM:

Ruby 1.9.1p431 (2011-02-18 revision 30908) [x86_64-linux]

* LOCAL GEMS *

activesupport (3.1.9) addressable (2.3.2) builder (3.1.4) bundler (1.2.3) classifier (1.3.3) curb (0.7.18) directory_watcher (1.4.1) faraday (0.8.4) faraday_middleware (0.9.0) fast-stemmer (1.0.1) feedzirra (0.1.3) hashie (1.2.0) i18n (0.6.1) jekyll (0.12.0) json (1.7.6) kramdown (0.13.8) liquid (2.4.1) loofah (1.2.1) maruku (0.6.1) multi_json (1.5.0, 1.2.0) multipart-post (1.1.5) netrc (0.7.7) nokogiri (1.5.6) octokit (1.20.0) pandoc-ruby (0.6.0) posix-spawn (0.3.6) pygments.rb (0.3.7) rake (10.0.3) rdoc (3.12) rubygems-bundler (1.1.0) rvm (1.11.3.5) sax-machine (0.1.0) simple_oauth (0.2.0) syntax (1.0.0) twitter (4.4.2) yajl-ruby (1.1.0)

Again, these gems should be installed when running the command

gem install jekyll feedzirra nokogiri twitter octokit pandoc-ruby

I got the following error when building the notebook in Jekyll:

Configuration from /home/oxberry1/carl_lab_notebook.git/_config.yml Building site: /home/oxberry1/carl_lab_notebook.git -> /home/oxberry1/carl_lab_notebook.git/_site YAML Exception reading 2010-02-09-Comparative-Phylogenetics-Notebook-(from-OWW).markdown: syntax error on line 2, col 22: tags: [model-choice, ]' YAML Exception reading 2010-02-16-Comparative-Phylogenetics-Notebook-(from-OWW).markdown: syntax error on line 2, col 22:tags: [model-choice, ]' YAML Exception reading 2010-03-04-Comparative-Phylogenetics-Notebook-(from-OWW).markdown: syntax error on line 2, col 21: `tags: [code-tricks, ]'

Liquid Exception: undefined method sort_by!' for #<Array:0x000000052fdf50> in tags.html /home/oxberry1/carl_lab_notebook.git/_plugins/tag-cloud.rb:75:inrender' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/liquid-2.4.1/lib/liquid/block.rb:94:in block in render_all' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/liquid-2.4.1/lib/liquid/block.rb:92:incollect' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/liquid-2.4.1/lib/liquid/block.rb:92:in render_all' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/liquid-2.4.1/lib/liquid/block.rb:82:inrender' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/liquid-2.4.1/lib/liquid/template.rb:124:in render' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/liquid-2.4.1/lib/liquid/template.rb:132:inrender!' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/convertible.rb:79:in do_layout' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/page.rb:100:inrender' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:204:in block in render' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:203:ineach' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:203:in render' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:41:inprocess' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/gems/jekyll-0.12.0/bin/jekyll:264:in <top (required)>' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/bin/jekyll:19:inload' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/bin/jekyll:19:in <main>' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/bin/ruby_noexec_wrapper:14:ineval' /home/oxberry1/.rvm/gems/ruby-1.9.1-p431@carl_notebook/bin/ruby_noexec_wrapper:14:in `

' Build Failed

As a test, I built the Jekyll-bootstrap site (cloned from its canonical Git repo today) using the two configurations above. The build worked flawlessly with the first configuration, and completed with minor HTML rendering errors in the second configuration. Any suggestions as to what might be going on?

My host OS is Fedora 17-x86_64, in case that matters. You should be able to use RVM and the gem lists above to replicate at least the Ruby part of my configuration.

goxberry commented 11 years ago

For the 1.9.3 version, I created another test case by stripping out all of the posts in your _posts directory except for the November 23rd post, and deleted the _posts/_source subdirectory. The error message I get on my laptop will be at the end of this comment.

The problem, it seems, has to do with gem dependencies.

For whatever reason, the combination of gems specified in your README.md picks up activesupport-3.1.9 and octokit-1.20.0. Depending on the order in which gems are loaded, dependencies may not be satisfied. On my work desktop, activesupport-3.1.9 picks up multi_json-1.5.0 instead of multi_json-1.2.0, and then jekyll returns an error saying that activesupport-3.1.9's dependencies aren't satisfied. In turn, activesupport-3.1.9 is a dependency of something else in your Ruby gem stack (haven't figured out what yet), so doing a "gem update activesupport" doesn't seem to help on my work desktop. On my personal MacBook Pro, octokit-1.20.0 returns an error, because its dependency is " multi_json (~> 1.3)" (judging from "gem dependency octokit"), and that conflicts with multi_json-1.2.0. Doing a "gem update" to update all gems hasn't resolved the problem on either my laptop or my work desktop, and my laptop is running OS X, so I'm pretty confident this issue is only a Ruby problem, and not an OS problem. (Plus, it's reproducible!)

Error message: (this time, run on my MacBook Pro instead of my work desktop)

Configuration from /Users/goxberry/carl_lab_notebook_lessposts.git/_config.yml WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.7.3 /Users/goxberry/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in raise_if_conflicts': Unable to activate octokit-1.20.0, because multi_json-1.2.0 conflicts with multi_json (~> 1.3) (Gem::LoadError) from /Users/goxberry/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:inactivate' from /Users/goxberry/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems.rb:212:in rescue in try_activate' from /Users/goxberry/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems.rb:209:intry_activate' from /Users/goxberry/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in rescue in require' from /Users/goxberry/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:inrequire' from /Users/goxberry/carl_lab_notebook_lessposts.git/_plugins/jekyll-labnotebook-plugins/github_feed.rb:2:in <top (required)>' from /Users/goxberry/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /Users/goxberry/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:78:inblock (2 levels) in setup' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:77:in each' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:77:inblock in setup' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:76:in each' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:76:insetup' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:31:in initialize' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/bin/jekyll:238:innew' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/bin/jekyll:238:in <top (required)>' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/bin/jekyll:19:inload' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/bin/jekyll:19:in <main>' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/bin/ruby_noexec_wrapper:14:ineval' from /Users/goxberry/.rvm/gems/ruby-1.9.3-p362@carl_notebook/bin/ruby_noexec_wrapper:14:in `

'

goxberry commented 11 years ago

Here's the similar-looking error message I got at work:

Configuration from /home/oxberry1/carl_lab_notebook_lessposts.git/_config.yml /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in raise_if_conflicts': Unable to activate activesupport-3.1.9, because multi_json-1.5.0 conflicts with multi_json (< 1.3, >= 1.0) (Gem::LoadError) from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:inactivate' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:780:in block in activate_dependencies' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:ineach' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in activate_dependencies' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:750:inactivate' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems.rb:212:in rescue in try_activate' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems.rb:209:intry_activate' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in rescue in require' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:inrequire' from /home/oxberry1/carl_lab_notebook_lessposts.git/_plugins/jekyll-labnotebook-plugins/mendeley_feed.rb:1:in <top (required)>' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /home/oxberry1/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:78:inblock (2 levels) in setup' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:77:in each' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:77:inblock in setup' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:76:in each' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:76:insetup' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/lib/jekyll/site.rb:31:in initialize' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/bin/jekyll:238:innew' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/gems/jekyll-0.12.0/bin/jekyll:238:in <top (required)>' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/bin/jekyll:19:inload' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/bin/jekyll:19:in <main>' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/bin/ruby_noexec_wrapper:14:ineval' from /home/oxberry1/.rvm/gems/ruby-1.9.3-p362@carl_notebook/bin/ruby_noexec_wrapper:14:in `

'

cboettig commented 11 years ago

So it sounds like there's a versioning conflict between octokit and whatever invokes the multi-jason? Not really sure where to start. Guess we could see what David Ketcheson did in his fork

cboettig commented 11 years ago

Appears to be an external dependency problem, possibly unique to rvm environment? Haven't been able to duplicate but will revisit when #45 gets addressed. For now, #wontfix

ketch commented 11 years ago

@goxberry I had the conflicting dependencies issue and solved it as follows:

gem uninstall octokit
gem install octokit --version 1.0.2
gem uninstall activesupport
gem install activesupport --version=3.1.1

Hope that helps.

cboettig commented 11 years ago

Thanks! I know basically nothing of ruby, but trying to figure out how to manage this in a more sensible way, particularly as my playing around with plugins introduces more gem dependencies. I've added a gemfile which lets me specify versions and sources for packages, so I should probably. I'll add version requirements to each gem. I haven't managed to reproduce the conflicting issues on my machine; for the record though, I'm running

octokit (1.24.0) activesupport (3.2.13, 3.1.12)

On Mon, Apr 22, 2013 at 11:11 AM, David Ketcheson notifications@github.comwrote:

@goxberry https://github.com/goxberry I had the conflicting dependencies issue and solved it as follows:

gem uninstall octokit gem install octokit --version 1.0.2 gem uninstall activesupport gem install activesupport --version=3.1.1

Hope that helps.

— Reply to this email directly or view it on GitHubhttps://github.com/cboettig/labnotebook/issues/46#issuecomment-16809810 .

Carl Boettiger UC Santa Cruz http://www.carlboettiger.info/

ketch commented 11 years ago

Update: labnotebook seems to work now with the latest versions of all packages, if you also upgrade to jekyll 1.0.0rc1 and use this patch for the pandoc plugin, which seems pretty hacky at the moment.

cboettig commented 10 years ago

plugins have been updated to work with the latest jekyll, and now versions of gems are properly sandboxed with bundler (provided you launch with bundle exec jekyll) future upgrades of gems shouldn't be able to break anything. Partly in proof of principle of the greater portability of this approach, notebook includes travis integration (#112) and the site is actually built by travis servers and deployed automatically when this repo is updated.