Cannot load such file — octopress/docs/hooks #102

Closed
NoahDragon opened this Issue May 4, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@NoahDragon

When I run the octopress command octopress docs, I got the following error:

~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/octopress-3.0.0/lib/octopress/docs.rb:223:in `require': cannot load such file -- octopress/docs/hooks (LoadError)

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/octopress-3.0.0/lib/octopress/docs.rb:223:in `load_docs'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/octopress-3.0.0/lib/octopress/commands/docs.rb:25:in `serve_docs'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/octopress-3.0.0/lib/octopress/commands/docs.rb:16:in `block (2 levels) in init_with_program'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'

from ~/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/octopress-3.0.0/bin/octopress:10:in `<top (required)>'

from ~/.rbenv/versions/1.9.3-p0/bin/octopress:23:in `load'

from ~/.rbenv/versions/1.9.3-p0/bin/octopress:23:in `

'

It looks like something is missing for my ruby. But I don't know what it exactly requires? What is the 'octopress/docs/hooks'?

Thank you in advance.

@imathis

This comment has been minimized.

Show comment
Hide comment
@imathis

imathis May 4, 2015

Member

I'm not sure why it wouldn't be able to access that file, it's this line which it is complaining about. @parkr do you know of any reason why this would be happening?

Member

imathis commented May 4, 2015

I'm not sure why it wouldn't be able to access that file, it's this line which it is complaining about. @parkr do you know of any reason why this would be happening?

@NoahDragon

This comment has been minimized.

Show comment
Hide comment
@NoahDragon

NoahDragon May 4, 2015

@imathis Thanks for reply. The similar error also occurs when I tried to use octopress new post to create a new blog page.

/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/octopress-3.0.0/lib/octopress/commands/new.rb:52:in `block (3 levels) in init_with_program': cannot load such file -- octopress/post (LoadError)

I'm thinking the problem may be caused by the ruby environment setting, but not sure how to fix it.

Because I just updated the my Octopress from 2.0 to 3.0, I wonder should I deploy the website by octopress first, then I could use the octopress commands?

@imathis Thanks for reply. The similar error also occurs when I tried to use octopress new post to create a new blog page.

/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/octopress-3.0.0/lib/octopress/commands/new.rb:52:in `block (3 levels) in init_with_program': cannot load such file -- octopress/post (LoadError)

I'm thinking the problem may be caused by the ruby environment setting, but not sure how to fix it.

Because I just updated the my Octopress from 2.0 to 3.0, I wonder should I deploy the website by octopress first, then I could use the octopress commands?

@imathis

This comment has been minimized.

Show comment
Hide comment
@imathis

imathis May 8, 2015

Member

Do you have gem "octopress" in your Gemfile? If not, add that and try bundle exec octopress docs.

Member

imathis commented May 8, 2015

Do you have gem "octopress" in your Gemfile? If not, add that and try bundle exec octopress docs.

@NoahDragon

This comment has been minimized.

Show comment
Hide comment
@NoahDragon

NoahDragon May 13, 2015

@imathis it works after modified the gemfile. Thank you.

@imathis it works after modified the gemfile. Thank you.

@NoahDragon NoahDragon closed this May 13, 2015

@garfieldnate

This comment has been minimized.

Show comment
Hide comment
@garfieldnate

garfieldnate Jul 20, 2015

Was just going to report this separately but I found this issue. I am having the same problem (also Octopress 3.0), but my gemfile does contain gem "octopress" in it (here).

octopress new draft, octopress doc, etc. don't work unless I call them with bundle exec. I am not very experienced with Ruby (sorry, I know you're probably sick of noob problems), so my little bit of debugging involved printing $: in octopress.rb:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/toml-0.1.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/colorator-0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-2.5.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-3.0.11/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/colorator-0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.2.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.6.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/hitimes-1.2.2-x86-mingw32/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/timers-4.0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.16.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rb-inotify-0.9.5/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.8/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-watch-1.2.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/classifier-reborn-2.0.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-2.5.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/titlecase-0.1.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-escape-code-2.0.6/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-3.0.11/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/safe_yaml-1.0.4/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.6.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/kramdown-1.8.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/blankslate-2.1.2.4/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/parslet-1.5.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/toml-0.1.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-paginate-1.1.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-gist-1.2.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-coffeescript-1.0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/coffee-script-2.4.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.5.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/coffee-script-source-1.9.1.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-sass-converter-1.3.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.16/lib
C:/Ruby193/lib/ruby/site_ruby/1.9.1
C:/Ruby193/lib/ruby/site_ruby/1.9.1/i386-msvcrt
C:/Ruby193/lib/ruby/site_ruby
C:/Ruby193/lib/ruby/vendor_ruby/1.9.1
C:/Ruby193/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt
C:/Ruby193/lib/ruby/vendor_ruby
C:/Ruby193/lib/ruby/1.9.1
C:/Ruby193/lib/ruby/1.9.1/i386-mingw32

and again where autoloading of draft.rb fails in new.rb:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/fssm-0.2.10/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/colorator-0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/coffee-script-2.4.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.5.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/coffee-script-source-1.9.1.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/classifier-reborn-2.0.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/chunky_png-1.3.4/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.16.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/timers-4.0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/hitimes-1.2.2-x86-mingw32/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/blankslate-2.1.2.4/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9-x86-mingw32/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9-x86-mingw32/lib/case_sensitive_require
C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9-x86-mingw32/ext
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib
C:/Ruby193/lib/ruby/site_ruby/1.9.1
C:/Ruby193/lib/ruby/site_ruby/1.9.1/i386-msvcrt
C:/Ruby193/lib/ruby/site_ruby
C:/Ruby193/lib/ruby/vendor_ruby/1.9.1
C:/Ruby193/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt
C:/Ruby193/lib/ruby/vendor_ruby
C:/Ruby193/lib/ruby/1.9.1
C:/Ruby193/lib/ruby/1.9.1/i386-mingw32

As you can see, the octopress/jekyll gems are no longer in the path at lazy-load time.

I also printed the trace of the failure:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-3.0.11/lib/octopress/commands/new.rb:72:in `block (3 levels) in init_with_program': cannot load such file -- octopress/draft (LoadError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-3.0.11/bin/octopress:8:in `<top (required)>'
        from C:/Ruby193/bin/octopress:23:in `load'
        from C:/Ruby193/bin/octopress:23:in `<main>'

I also tried switching out the autoload statements in octopress.rb with explicit require statements and this fixed the immediate problem (though the same error was then thrown when Jekyll classes could not be found).

Was just going to report this separately but I found this issue. I am having the same problem (also Octopress 3.0), but my gemfile does contain gem "octopress" in it (here).

octopress new draft, octopress doc, etc. don't work unless I call them with bundle exec. I am not very experienced with Ruby (sorry, I know you're probably sick of noob problems), so my little bit of debugging involved printing $: in octopress.rb:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/toml-0.1.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/colorator-0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-2.5.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-3.0.11/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/colorator-0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.2.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.6.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/hitimes-1.2.2-x86-mingw32/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/timers-4.0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.16.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rb-inotify-0.9.5/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.8/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-watch-1.2.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/classifier-reborn-2.0.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-2.5.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/titlecase-0.1.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-escape-code-2.0.6/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-3.0.11/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/safe_yaml-1.0.4/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.6.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/kramdown-1.8.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/blankslate-2.1.2.4/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/parslet-1.5.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/toml-0.1.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-paginate-1.1.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-gist-1.2.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-coffeescript-1.0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/coffee-script-2.4.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.5.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/coffee-script-source-1.9.1.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-sass-converter-1.3.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.16/lib
C:/Ruby193/lib/ruby/site_ruby/1.9.1
C:/Ruby193/lib/ruby/site_ruby/1.9.1/i386-msvcrt
C:/Ruby193/lib/ruby/site_ruby
C:/Ruby193/lib/ruby/vendor_ruby/1.9.1
C:/Ruby193/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt
C:/Ruby193/lib/ruby/vendor_ruby
C:/Ruby193/lib/ruby/1.9.1
C:/Ruby193/lib/ruby/1.9.1/i386-mingw32

and again where autoloading of draft.rb fails in new.rb:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/fssm-0.2.10/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/colorator-0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/coffee-script-2.4.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/execjs-2.5.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/coffee-script-source-1.9.1.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/classifier-reborn-2.0.3/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/chunky_png-1.3.4/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.16.0/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/timers-4.0.1/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/hitimes-1.2.2-x86-mingw32/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/blankslate-2.1.2.4/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9-x86-mingw32/lib
C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9-x86-mingw32/lib/case_sensitive_require
C:/Ruby193/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.9-x86-mingw32/ext
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.6.3/lib
C:/Ruby193/lib/ruby/site_ruby/1.9.1
C:/Ruby193/lib/ruby/site_ruby/1.9.1/i386-msvcrt
C:/Ruby193/lib/ruby/site_ruby
C:/Ruby193/lib/ruby/vendor_ruby/1.9.1
C:/Ruby193/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt
C:/Ruby193/lib/ruby/vendor_ruby
C:/Ruby193/lib/ruby/1.9.1
C:/Ruby193/lib/ruby/1.9.1/i386-mingw32

As you can see, the octopress/jekyll gems are no longer in the path at lazy-load time.

I also printed the trace of the failure:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-3.0.11/lib/octopress/commands/new.rb:72:in `block (3 levels) in init_with_program': cannot load such file -- octopress/draft (LoadError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/octopress-3.0.11/bin/octopress:8:in `<top (required)>'
        from C:/Ruby193/bin/octopress:23:in `load'
        from C:/Ruby193/bin/octopress:23:in `<main>'

I also tried switching out the autoload statements in octopress.rb with explicit require statements and this fixed the immediate problem (though the same error was then thrown when Jekyll classes could not be found).

@rafaeleyng rafaeleyng referenced this issue in codeheaven-io/codeheaven.io Jan 10, 2016

Closed

Error on `jekyll serve` #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment