【问题标题】:Rails 3.2 GNTP not sending notificationsRails 3.2 GNTP不发送通知
【发布时间】:2012-05-12 23:13:35
【问题描述】:

我正在使用 Rails 3.2.2 并尝试使用 ruby_gntp gem 从 Guard 发送 Growl 通知。

我在 Snow Lepoard 上,所以使用 Growl 1.2.2。

这是我的 gem 文件。

source 'https://rubygems.org'

gem 'rails', '3.2.2'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

group :assets do
  gem 'coffee-rails'
  gem 'uglifier'
end

gem 'jquery-rails'

group :development, :test do
  gem 'capybara'
  gem 'rspec-rails'
  gem 'guard-rspec'
  gem 'rb-fsevent'
  gem 'ruby_gntp'
end

# Gems used only for assets and not required
# in production environments by default.
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

当我使用 bundle exec guard 命令运行 Guard 时。我收到以下...

Running all specs
No examples found.


Finished in 0.00005 seconds
0 examples, 0 failures
ERROR: Error sending notification with gntp: Connection refused - connect(2)

我做了一些研究,发现这可能是我之前安装的咆哮 gem 的版本错误。我已经删除了这些宝石,但仍然收到错误消息。

编辑:得到它的工作 :) 只需在我的 gem 文件中将 ruby_gntp 更改为 growl gem。

我的 gemfile 现在读取了..

来源“https://rubygems.org”

gem 'rails', '3.2.2'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

group :assets do
  gem 'coffee-rails'
  gem 'uglifier'
end

gem 'jquery-rails'

group :development, :test do
  gem 'capybara'
  gem 'rspec-rails'
  gem 'guard-rspec'
  gem 'rb-fsevent'
  gem "growl", :git => "https://github.com/visionmedia/growl.git"
end

# Gems used only for assets and not required
# in production environments by default.
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-3 rubygems guard


    【解决方案1】:

    通过 Mac App Store 更新 Growl 后,我遇到了同样的错误。

    我通过在 Growl 的 1.2.2. disk image(在 download page 中列出)中重新安装来自 Extras/growlnotify/growlnotify.pkg 的 growlnotify 解决了这个问题。

    【讨论】:

      【解决方案2】:

      我在 OS X 10.8 上遇到了完全相同的错误。在 Mac OS X 10.8 + 上,通过 Grows 的通知与 gemfile 中的此类 gem 一起使用:

      group :development, :test do
        gem 'rb-fsevent'
        gem 'guard-rspec'                                                                       
        gem 'ruby_gntp'
      end
      

      别忘了打开 Growl。

      我还建议使用 gem terminal-notifier-guard。它通过 Mac 通知中心提供通知。

      【讨论】:

        【解决方案3】:

        Ruby GNTP 至少需要 Growl 1.3 版的Guard README explains。我建议安装Growl 通知程序,它适用于所有 Growl 版本。

        【讨论】:

          猜你喜欢
          • 2015-04-02
          • 1970-01-01
          • 1970-01-01
          • 2018-11-27
          • 1970-01-01
          • 1970-01-01
          • 2014-06-09
          • 2020-05-12
          • 2013-09-05
          相关资源
          最近更新 更多