3

私は持っている:

$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
$ middleman version
Middleman 2.0.13.1
$ cat /etc/debian_version 
6.0.3

次のようにプロジェクトを開始した場合:

$ middleman init np --rack --bundler --template=html5
      np/config.ru を作成
      np/Gemfile を作成
         バンドルのインストールを実行
http://rubygems.org/ のソース インデックスを取得しています
multi_json の使用 (1.0.3)
アクティブサポート (3.1.1) の使用
アドレス可能 (2.2.6) の使用
chunky_png の使用 (1.2.5)
coffee-script-source (1.1.2) の使用
execjs (1.2.9) の使用
コーヒースクリプトの使用 (2.2.0)
fssm (0.2.7) の使用
サスの使用 (3.1.10)
コンパスの使用 (0.11.5)
デーモンの使用 (1.1.4)
eventmachine の使用 (0.12.10)
em-websocket (0.3.3) の使用
トールの使用 (0.14.6)
ガードの使用 (0.6.3)
Guard-livereload の使用 (0.3.1)
Haml の使用 (3.1.3)
ハイクの使用 (1.2.1)
ラックの使用 (1.3.5)
url_mount (0.2.1) の使用
http_router (0.10.2) の使用
i18n (0.6.0) の使用
構文の使用 (1.0.0)
マルクの使用 (0.6.0)
middleman-livereload の使用 (0.2.1)
ラック保護の使用 (1.1.4)
傾きの使用 (1.3.3)
シナトラの使用 (1.3.1)
padrino-core (0.10.5) の使用
padrino-helpers の使用 (0.10.5)
ラックテストの使用 (0.6.1)
テンプルの使用 (0.3.4)
スリムの使用 (1.0.3)
スプロケットの使用 (2.0.3)
シン (1.2.11) の使用
uglifier の使用 (1.0.4)
仲介者の使用 (2.0.13.1)
バンドラーの使用 (1.0.21)
バンドルが完成しました!バンドルされた gem がインストールされている場所を確認するには、「bundle show [gemname]」を使用します。
      np/config.rb を作成
      np/ソースを作成
      np/source/404.html を作成
      np/source/README.md を作成
      np/source/apple-touch-icon-114x114-precomposed.png を作成します
      np/source/apple-touch-icon-57x57-precomposed.png を作成します
      np/source/apple-touch-icon-72x72-precomposed.png を作成します
      np/source/apple-touch-icon-precomposed.png を作成します
      np/source/apple-touch-icon.png を作成
      np/source/crossdomain.xml を作成します
      np/source/css/style.css を作成
      np/source/favicon.ico を作成します
      np/source/humans.txt を作成します
      np/source/img/.gitignore を作成
      np/source/index.html を作成
      np/source/js/libs/jquery-1.6.2.js を作成します
      np/source/js/libs/jquery-1.6.2.min.js を作成します
      np/source/js/libs/modernizr-2.0.6.min.js を作成します
      np/source/js/mylibs/.gitignore を作成します
      np/source/js/plugins.js を作成します
      np/source/js/script.js を作成
      np/source/robots.txt を作成します
      np/source/test/index.html を作成
      np/source/test/qunit/qunit.css を作成します
      np/source/test/qunit/qunit.js を作成します
      np/source/test/tests.js を作成します
       np/ソースが存在する

ディレクトリに移動して、プレビューを実行します。

$ cd np/
$仲買人サーバー
Linux inotify サポートのために rb-inotify gem をインストールしてください
ポーリングの使用 (それよりもシステムをサポートするためにご協力ください。)
インライン Guardfile の使用。
Guard は現在、「/tmp/np」を監視しています
/home/blt/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:「autodetect」で: JavaScript ランタイムが見つかりませんでした。利用可能なランタイムのリストについては、https://github.com/sstephenson/execjs を参照してください。(ExecJS::RuntimeUnavailable)
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs.rb:5:in `'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs.rb:4:in `'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/renderers/coffee_script.rb:4:in `require'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/renderers/coffee_script.rb:4:in `登録済み'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1262:in `block in register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `each'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/core_extensions/rendering.rb:14:in `登録済み'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1262:in `block in register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `each'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/base.rb:54:in `登録済み'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1262:in `block in register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `each'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman.rb:180:in `サーバー'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman.rb:191:in `start_server'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:58:in `block in server_start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:57:in `fork'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:57:in `server_start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:47: in `start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.6.3/lib/guard.rb:66:in `supervised_task'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.6.3/lib/guard.rb:43:in `block in start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.6.3/lib/guard.rb:43:in `each'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.6.3/lib/guard.rb:43: in `start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:34:in `start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/cli.rb:55:in `サーバー'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/bin/middleman:52: in `start_cli!'
    /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/bin/middleman:47: から `did_locate_middleman_project' で
    /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/bin/middleman:20: から `locate_middleman_root!' で
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/bin/middleman:70:in `'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/bin/middleman:19:in `load'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/bin/middleman:19:in `'
バイバイ...

それにもかかわらず:

$ 宝石リスト | grep レーサー
therubyracer (0.9.8)

$ 宝石リスト | grep inotify
rb-inotify (0.8.8)

RVMインストール ガイドと Middleman Getting Startedに従いました。Middleman がサーバーの起動に失敗する理由はありますか?

4

3 に答える 3

5

middleman serverユーザーは、Gemfile のみに基づくサンドボックスを使用しているようです。gem をグローバルにインストールした場合、それらは実行時にサンドボックスに存在しません。によって作成された元の Gemfile はmiddleman init次のようになります。

source "http://rubygems.org"
gem "middleman", "~>2.0.13.1"

これを次のように編集します。

source "http://rubygems.org"

gem "middleman", "~>2.0.13.1"
gem "rb-inotify"
gem "therubyracer"

必要に応じて、怠惰ではなく、オペレーティング システムによってこれをパラメーター化できます。

于 2011-10-22T14:54:02.380 に答える
0

Gemfile.lock ファイルを削除してからルート ディレクトリで実行する場合

bundle install --binstubs ./bin --path vendor/bundle

バンドルはすべてのパッケージをローカルにインストールします (および ./bin で起動するためのすべての実行可能ファイル)

それが役立つ場合は、私のテンプレートを試して開始することもできます

http://github.com/vladp/middleman-Simple-Site

于 2014-01-26T02:57:39.823 に答える
-1

注目したいラインはこちら

/home/blt/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:「autodetect」で: JavaScript ランタイムが見つかりませんでした。利用可能なランタイムのリストについては、https://github.com/sstephenson/execjsを参照してください。(ExecJS::RuntimeUnavailable)

基本的に、node js や v8 などの js ランタイムをシステムにインストールして、execjs が動作できるようにする必要があります。これを注意深く読んでください

于 2011-10-22T14:06:54.947 に答える