7

Octopressドキュメントのすべての指示に従いました:

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

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)

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)

私はRubyに取り組んだことがないことを認めます。したがって、エラーのスクランブルを解除するのはあまり快適ではありません。グーグル検索も私が理解できるものを何ももたらさなかった。

編集:

回答で述べたように、私はrbenvをインストールしてからruby 1.9.3-p327。私は戻って~/octopress走りましたbundle install、そしてそれはすべての宝石がすでにインストールされていると言いました(私がルビー1.8xを持っていたときに私はそれをしました)。そして今、rakeは私にこのエラーを与えます:

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>'

すべてのgemをバンドルして再インストールする必要がありますか?理解できません。

4

3 に答える 3

3

ちょうど試して

$ rvm use 1.9.3

サイトのルートフォルダにあります。注意してください、1.9.3はあなたのRubyバージョンです。

それならあなたが走ると

$ rake watch

また

$ rake preview

今動作します。


編集:

したがって、のためrbenvに、試してみてください:

$ rbenv global 1.9.3-p327

または、代わりに使用できますlocal

于 2012-12-09T06:08:55.307 に答える
1

問題は古いRubyにあると思います。これによると:https ://github.com/imathis/octopress/issues/142 Ruby 1.9を使用している必要があります(安定バージョンは1.9.3-p327になりました)。これはRubyサイトから直接入手できますが、RVM(またはrbenv)を使用してRuby環境をセットアップすることをお勧めします。

ボックスにRVMをインストールする方法のガイドは、https ://rvm.io/rvm/install/にあります。

次に、Ruby1.9.3のインストールは次のように簡単になります。

rvm install 1.9.3
rvm --default 1.9.3
rvm reload

次に、bundle installbundler:)を使用してすべての依存関係gem install bundlerをOctopressルートディレクトリにインストールする必要があります。

編集:

また.rvmrc、Octopressのプロジェクトルートでは、Ruby 1.9.3が必要であると述べています:https ://github.com/imathis/octopress/blob/master/.rvmrc

于 2012-12-08T18:09:54.150 に答える
1

rbenv構成のステップ3を見逃しましたか?

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

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

于 2013-04-15T03:22:24.943 に答える