【问题标题】:Rails config.gem error on gem installed安装 gem 时出现 Rails config.gem 错误
【发布时间】:2010-08-17 14:23:06
【问题描述】:

我已经安装了这个 gem:googlecharts.rubyforge.org,但我不想每次在我的操作中都需要它,所以我尝试用 Rails 的方式来做:

config.gem 'mattetti-googlecharts'

然后我去启动我的服务器并得到这个错误:

缺少这些必需的宝石:
mattetti-googlecharts

您正在运行:ruby 1.8.7.174 at /usr/bin/ruby1.8 ruby​​gems 1.3.5 在 /home/laptop/.gem/ruby/1.8, /var/lib/gems/1.8

运行rake gems:install 安装 缺少宝石。

但是 gem 已安装!我也试过这个变种:

config.gem 'mattetti-googlecharts', :lib => 'gcharts'

【问题讨论】:

    标签: ruby-on-rails


    【解决方案1】:

    使用RubyGems repository。 GitHub gem 已过时。

    $ gem install googlecharts
    

    然后在你的应用中

    config.gem 'googlecharts'
    

    您不需要gchart because of this。另请注意,您试图要求 gcharts.rb,而不是 gchart.rb

    【讨论】:

    • Tnxs。你能解释一下为什么 config.gem 'mattetti-googlecharts' 不起作用吗?如果更新了,我应该只调用每个“googlecharts”吗?
    • 因为您需要 gcharts 而不是 gchart
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 2013-10-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多