2
1. Install Ruby on Rails

sudo gem install rails
2. Install the Juggernaut Gem

sudo gem install juggernaut
3. Download the demo app and unpack it.

4. Start the Rails application

ruby script/server
5. Start the Juggernaut server

juggernaut -c juggernaut.yml
6. Open the browser and go to http://localhost:3000

私は午前中ずっとこれらの非常に簡単な指示に従おうとしましたが、私のコンピューターはすべてのジャガーノートアプリケーションで問題を抱えているようです. ruby をインストールし、juggernaut をインストールし、git は github からアプリケーションを複製しました。次に、ディレクトリを cd してrails s. 私は得た

Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]           # Path to the Ruby binary of your choice
                              # Default: /Users/fred/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
  -d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)
                              # Default: sqlite3
  -b, [--builder=BUILDER]     # Path to an application builder (can be a filesystem path or URL)
  -m, [--template=TEMPLATE]   # Path to an application template (can be a filesystem path or URL)
      [--dev]                 # Setup the application with Gemfile pointing to your Rails checkout
      [--edge]                # Setup the application with Gemfile pointing to Rails repository
      [--skip-gemfile]        # Don't create a Gemfile
  -O, [--skip-active-record]  # Skip Active Record files
  -T, [--skip-test-unit]      # Skip Test::Unit files
  -J, [--skip-prototype]      # Skip Prototype files
  -G, [--skip-git]            # Skip Git ignores and keeps

Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -q, [--quiet]    # Supress status output
  -s, [--skip]     # Skip files that already exist

Rails options:
  -v, [--version]  # Show Rails version number and quit
  -h, [--help]     # Show this help message and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.

私はそれから試しjuggernaut -c juggernaut.ymlてみました

/Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/maccman-juggernaut-0.5.9/lib/juggernaut/server.rb:128: warning: else without rescue is useless
/Users/fred/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require': /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/maccman-juggernaut-0.5.9/lib/juggernaut/server.rb:122: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' (SyntaxError)
        when :broadcast: broadcast_command
                        ^
/Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/maccman-juggernaut-0.5.9/lib/juggernaut/server.rb:363: syntax error, unexpected keyword_end, expecting $end
    from /Users/fred/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/maccman-juggernaut-0.5.9/lib/juggernaut.rb:157:in `<top (required)>'
    from /Users/fred/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
    from /Users/fred/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:54:in `require'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/gems/maccman-juggernaut-0.5.9/bin/juggernaut:3:in `<top (required)>'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/bin/juggernaut:19:in `load'
    from /Users/fred/.rvm/gems/ruby-1.9.2-p180/bin/juggernaut:19:in `<main>'

誰か助けてください。ちなみに、ジャガーノート以外のレールアプリはすべて私のコンピューターで正常に動作します。

4

2 に答える 2

0

'warning: else without rescue is useless'まったく別のものでこのエラーが発生しました。

奇妙なものですが、エラーを生成する方法を確認したら、問題を見つけて修正しました。

http://nofail.de/2011/12/ruby-quirks/

基本的に、Gem または追加したコードのどこかに、不正なifステートメントがあります。

奇妙なことに、このエラーは 1 人の開発者を除いて問題を引き起こしていませんでした。この不正な形式ifは本番環境に移行し、機能しているように見えます。彼の開発ボックスでは、エラーにフラグを立ててから、違法な命令を実行して終了します。

于 2013-03-01T01:31:37.330 に答える
0

centosでも同様の問題が発生しました。これは、gem のセットアップが正しくない場合に発生する可能性があります (sudo と関係があるかどうかはわかりません)。

バンドラー内で実行してみてください bundle exec rails s

于 2011-08-28T13:17:04.013 に答える