0

我正在尝试将 intercom.io 安装到我的 rails 应用程序中,但是在生成配置文件时我得到了这个:

/var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails/config.rb:13:in `send': undefined method `define_singleton_method' for IntercomRails::Config:Class (NoMethodError)
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails/config.rb:13:in `config_reader'
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails/config.rb:8:in `config_accessor'
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails/config.rb:74
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails.rb:9:in `require'
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails.rb:9
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `require'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
from /home/ian/SB/config/application.rb:7
from /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/commands.rb:24:in `require'
from /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/commands.rb:24
from script/rails:6:in `require'
from script/rails:6
4

1 回答 1

1

看起来您使用的是 ruby​​ 1.8,我们的 gem 当前使用 ruby​​ 1.9 功能Object#define_singleton_method

我们在intercom/intercom-rails github repo上创建了一个问题来跟踪修复此问题。有新版本时我会通知你的。

如果可能,建议在 ruby​​ >= 1.9.3 上运行 rails 3+(这对我们来说至少意味着不从源代码安装)。

谢谢让我们注意到这个。

于 2013-02-11T00:34:59.043 回答