'其他没有救援是没用的'和'需要'在Mac 10.6上的juggernaut / ruby​​问题

时间:2011-07-29 23:15:43

标签: ruby-on-rails ruby-on-rails-3 macos comet juggernaut

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

有人可以帮助我。顺便说一句,任何非主宰轨道应用程序在我的计算机上都能正常工作。

2 个答案:

答案 0 :(得分:0)

我在centos上遇到过类似的问题。如果宝石设置不正确(不知道与sudo有什么关系),可能会发生这种情况。

尝试在捆绑器中运行它 bundle exec rails s

答案 1 :(得分:0)

我有一个完全不同的错误'warning: else without rescue is useless'

这是一个奇怪的,但是一旦我看到你如何产生错误,我发现了问题并修复了它。

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

基本上在Gem的某个地方或您添加的代码中,您的语句格式错误if

奇怪的是,除了一个开发人员之外,这个错误并没有引起问题。这个格式错误的if使其投入生产并且似乎正在运作。在他的开发框中,它会标记错误,然后执行ILLEGAL INSTRUCTION并死掉。