代码之家  ›  专栏  ›  技术社区  ›  particle

如何阻止加载以前版本的gem?

  •  0
  • particle  · 技术社区  · 14 年前

    PATH GEM_HOME 指向本地安装文件夹。这是由网络托管服务(webfaction)推荐的,工作正常。

    现在的问题是我安装了haml的新版本。我可以检查一下。

    [user@abc n2]$ gem list -d haml
    
    *** LOCAL GEMS ***
    
    haml (3.0.23)
        Authors: Nathan Weizenbaum, Chris Eppstein, Hampton Catlin
        Rubyforge: http://rubyforge.org/projects/haml
        Homepage: http://haml-lang.com/
        Installed at: /home/myhome/webapps/mysite/gems
    
        An elegant, structured XHTML/XML templating engine. Comes with Sass,
        a similar CSS templating engine.
    

    但当我出于某种原因 haml-2.2.9 haml-3.0.23 . 我无权进入 它可能安装在某个根文件夹下,而我无权访问该文件夹。我怎样才能解决这个问题。请记住,我只对“按主文件夹”及其下的内容拥有权限。这个 haml-2.29

    [user@abc n2]$ rake gems
    (in /home/myhome/webapps/mysite/n2)
     - [F] haml
     - [I] eycap
        - [I] capistrano >= 2.2.0
           - [I] net-ssh >= 2.0.14
           - [I] net-sftp >= 2.0.0
              - [I] net-ssh >= 2.0.9
           - [I] net-scp >= 1.0.0
              - [I] net-ssh >= 1.99.1
           - [I] net-ssh-gateway >= 1.0.0
              - [I] net-ssh >= 1.99.1
           - [I] highline
        - [I] hoe >= 1.5.1
           - [I] rubyforge >= 2.0.4
              - [I] json_pure >= 1.1.7
           - [R] rake >= 0.8.7
     - [F] whenever
        - [I] chronic >= 0.2.3
     - [F] rack
     - [F] formtastic
        - [R] activesupport >= 2.3.0
        - [R] actionpack >= 2.3.0
     - [I] hpricot
     - [F] friendly_id
        - [R] activerecord >= 2.2.3
        - [R] activesupport >= 2.2.3
     - [F] will_paginate ~> 2.3.11
     - [I] compass
    rake aborted!
    can't activate , already activated haml-2.2.9
    
    1 回复  |  直到 14 年前
        1
  •  0
  •   Michael Eakins    14 年前

    我找到解决办法了。我发表了评论 config.gem 从开始到加载 compass haml-3.0.23 所以现在它加载正确了。我改变了 /config/envirnoment.rb

      config.gem "compass"
     # config.gem "haml"
      config.gem "eycap"
      config.gem "whenever"
      config.gem "rack"
      config.gem "formtastic"
      config.gem "hpricot"
      config.gem "friendly_id"
      config.gem 'will_paginate', :version => '~> 2.3.11', :source => 'http://gemcutter.org'
     # config.gem "compass"
      config.gem "compass-960-plugin", :lib => 'ninesixty'