“否则不救援是没有用的”并“要求” Mac 10.6 上的 juggernaut/ruby 问题

发布于 2024-11-27 04:58:19 字数 3780 浏览 7 评论 0原文

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

有人可以帮助我吗?顺便说一句,任何非主流 Rails 应用程序都可以在我的计算机上正常运行。

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

I have attempted all morning to follow these very simple instructions but my computer seems so have problems with every single juggernaut application. I installed ruby, installed juggernaut and git cloned the application from github. Then I cd'd the directory and attempted rails s. I got

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.

I then tried juggernaut -c juggernaut.yml and got

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

Can someone PLEASE help me. Any non-juggernaut rails app works fine on my computer by the way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冷默言语 2024-12-04 04:58:19

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

请尝试在捆绑程序中运行它
捆绑执行rails

I have had similar problems on centos. This could happen if the gem setup is incorrect (don't know what but something to do with sudo)

try running it within a bundler
bundle exec rails s

鸠魁 2024-12-04 04:58:19

我遇到了这个错误'警告:否则没有救援是无用的'与完全不同的东西。

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

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

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

奇怪的是,除了一名开发人员之外,这个错误并没有引起问题。这个格式错误的 if 已投入生产并且似乎可以正常工作。在他的开发盒上,它会标记错误,然后执行非法指令并死亡。

I had this error 'warning: else without rescue is useless' with something completely different.

Its a strange one, but once I saw how you can generate the error, I found the problem and fixed it.

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

Basically somewhere in the Gem or in the code you added, you have a malformed if statement.

Strangely this error was not causing issues except for one developer. This malformed if made it to production and appears to be working. On his development box it would flag the error and then do ILLEGAL INSTRUCTION and die.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文