首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Warbler:不支持Path Gems

Warbler:不支持Path Gems
EN

Stack Overflow用户
提问于 2013-10-11 17:13:48
回答 1查看 370关注 0票数 0

这就是我的问题: Warbler不支持gem,gem是通过路径包含在gemfile中的。然而,我需要为我的工作做这件事。重要的是,将包含的gem打包并作为war归档中的一个简单rubygem进行处理。到目前为止,我一直在尝试操纵捆绑器,所以当规范到达warbler/trait/bundler.rb(规范被打包到归档中的地方)时,它已经有了' bundler :: source ::Rubygems‘作为源代码。问题是它需要从路径构建和安装,但我不能处理它来传递规范或源代码中的任何路径。gem作为rubygem被构建、安装和打包到归档中,并在Lockfile中的GEM下列出,但只使用了错误的编码(它都引用了特定的gem,路径输入得很清楚)。

下面是我的代码:

warbler/lib/warbler/bunlder.rb/bunlder.rb行: 60

代码语言:javascript
复制
case spec.source
          when ::Bundler::Source::Git
            config.bundler[:git_specs] ||= []
            config.bundler[:git_specs] << spec
          when ::Bundler::Source::Path
            $stderr.puts("warning: Bundler `path' components are not currently   supported.",
                         "The `#{spec.full_name}' component was not bundled.",
                         "Your application may fail to boot!")
          else

#####################################################################  MINE
            if spec.name == "charla_common" 
             path = ::Bundler::GemHelper.new("../../common/trunk", spec.name).install_gem
            end
##################################################################### MINE END
            config.gems << spec
          end

这是gem的安装路径

Bundler/lib/bundler/dsl.rb行: 120

代码语言:javascript
复制
def source(source, options = {})

############################################################### MINE
      if source.class == Bundler::Source::Path
        options[:path] = source.options["path"]
        source = "https://rubygems.org"
      end
############################################################### MINE END
      case source
      when :gemcutter, :rubygems, :rubyforge then
        Bundler.ui.warn "The source :#{source} is deprecated because HTTP " \
          "requests are insecure.\nPlease change your source to 'https://" \
          "rubygems.org' if possible, or 'http://rubygems.org' if not."
        @rubygems_source.add_remote "http://rubygems.org"
        return
      when String
        # ensures that the source in the lockfile is shown only once
        unless options[:prepend] 
          @rubygems_source.add_remiote source
        end
        return
      else
        @source = source
        if options[:prepend]
          @sources = [@source] | @sources
        else
          @sources = @sources | [@source]
        end

        yield if block_given?
        return @source
      end
    ensure
      @source = nil
    end
EN

回答 1

Stack Overflow用户

发布于 2014-01-28 21:48:29

我不确定这是否适合您,但是为了解决这个问题,我在供应商/缓存中创建了指向包含gem的路径的符号链接。

例如,vendor/cache/gem_name -> ../../../gem_name

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19314453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档