Octopress errors - rake preview, watch or generate
Asked Answered
W

3

7

I followed all instructions in Octopress Documentation:

sddhrthrt@thinkpad:~/octopress$ rake generate
## Generating Site with Jekyll
directory source/stylesheets/ 
   create source/stylesheets/screen.css 
Configuration from /home/sddhrthrt/octopress/_config.yml
/home/sddhrthrt/octopress/plugins/pygments_code.rb:5: 
      warning: already initialized constant PYGMENTS_CACHE_DIR
/home/sddhrthrt/octopress/plugins/render_partial.rb:25:in `require':
             ./plugins/octopress_filters.rb:69: undefined (?...) sequence:
              /<div class="entry-content">(?<content>[\s\S]*?)<\/div>\s*<(footer|\/article)>/ (SyntaxError)
        from /home/sddhrthrt/octopress/plugins/render_partial.rb:25
        from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:76:in `require'
        from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:76:in `setup'
        from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:75:in `each'
        from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:75:in `setup'
        from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/../lib/jekyll/site.rb:30:in `initialize'
        from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/jekyll:224:in `new'
        from /var/lib/gems/1.8/gems/jekyll-0.11.2/bin/jekyll:224
        from /usr/local/bin/jekyll:19:in `load'
        from /usr/local/bin/jekyll:19

And

sddhrthrt@thinkpad:~/octopress$ rake preview
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000
rake aborted!
undefined method `spawn' for Process:Module

Tasks: TOP => preview
(See full trace by running task with --trace)

and

sddhrthrt@thinkpad:~/octopress$ rake watch
Starting to watch source with Jekyll and Compass.
rake aborted!
undefined method `spawn' for Process:Module

Tasks: TOP => watch
(See full trace by running task with --trace)

I've never worked on Ruby, I admit. Hence i'm not very comfortable unscrambling the errors. Google search also didn't yield anything I could comprehend.

EDIT:

So mentioned in the answers, I installed rbenv and then ruby 1.9.3-p327. I came back to ~/octopress and ran bundle install and it said all the gems were already installed (I had done that when I had ruby 1.8x). And now rake gives me this error:

sddhrthrt@thinkpad:~/octopress$ rake --trace
rake aborted!
cannot load such file -- bundler/setup
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/sddhrthrt/octopress/Rakefile:2:in `<top (required)>'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/rake_module.rb:25:in `load'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/rake_module.rb:25:in `load_rakefile'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:501:in `raw_load_rakefile'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:82:in `block in load_rakefile'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:81:in `load_rakefile'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:65:in `block in run'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rake/application.rb:63:in `run'
/home/sddhrthrt/.rbenv/versions/1.9.3-p194/bin/rake:32:in `<main>'

Should I reinstall using bundle all the gems? I cant understand.

Whallon answered 8/12, 2012 at 15:22 Comment(1)
What Ruby version do you have? (EDIT: I've noticed that you have 1.8.X)Chlor
C
3

Just try

$ rvm use 1.9.3

in your site's root folder. Note, 1.9.3 is your Ruby version.

Then I think when you run

$ rake watch

or

$ rake preview

will work now.


EDIT:

So, for rbenv, try:

$ rbenv global 1.9.3-p327

or you can use local instead.

Chestonchest answered 9/12, 2012 at 6:8 Comment(5)
i'm not using rvm. I used rbenv to install the new rubyWhallon
@Whallon you can try rbenv global 1.9.3-p327.Chestonchest
I tried that already. The problem is, when i do build exec rake, it uses binaries from Ruby 1.8.Whallon
@Whallon ruby -v to check what the really version is in using?Chestonchest
okay, after a lot of juggling, i guess I've messed up the whole ruby setup in my comp. When i run ruby, I get this error now - <internal:gem_prelude>:1:in require': cannot load such file -- rubygems.rb (LoadError) from <internal:gem_prelude>:1:in <compiled>'Whallon
M
1

I suppose that the problem is with outdated Ruby. According to this: https://github.com/imathis/octopress/issues/142 you should be on Ruby 1.9 (the stable version is now 1.9.3-p327). You can get this directly from Ruby site, but I would suggest using RVM (or rbenv) to setup your Ruby environment.

You can find a guide how to install RVM on your box here: https://rvm.io/rvm/install/

Then installing Ruby 1.9.3 will be as simple as:

rvm install 1.9.3
rvm --default 1.9.3
rvm reload

Then you will have to install all the dependancies with bundle install (to get bundler: gem install bundler) in Octopress root directory.

EDIT:

Also .rvmrc in Octopress' project root says that it requires Ruby 1.9.3: https://github.com/imathis/octopress/blob/master/.rvmrc

Metalware answered 8/12, 2012 at 18:9 Comment(2)
I've put the changes in the question.Whallon
Have you tried running tasks with bundle exec? For example bundle exec rake preview.Chlor
C
1

Did you miss step 3 of rbenv configuration ?

$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

https://github.com/sstephenson/rbenv/#rbenv-shell

Cysticercus answered 15/4, 2013 at 3:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.