How to use a branch in a fork of rails in a project with bundler

后端 未结 2 704
别跟我提以往
别跟我提以往 2020-12-31 08:04

I\'ve got a fork of the rails repo on github, in which I\'ve got a branch, based on the rails-2-3-stable branch. I want to develop some changes based on rails 2.3.10 togethe

2条回答
  •  情话喂你
    2020-12-31 08:39

    balu's answer pointed me to the right course, but here are some more details:

    It was necessary to cobble together .gemspec files for most of the gems in the rails repo/2-3-stable branch - my take can be seen or forked at http://github.com/traveliq/rails/commit/46d9042c9125abbbedfc672f8523d81210f4f320

    To include that in a Gemfile, use:

    git "git://github.com/traveliq/rails.git", :branch => 'tiq-fixes' do
      gem 'rails'
      gem 'actionmailer'
      gem 'actionpack'
      gem 'activerecord'
      gem 'activeresource'
      gem 'activesupport'
    end
    

    Note that you can't use 'railties', that only defines the 'rails' gem.

    Incidentally, while working on this, it was way easier to point the Gemfile at my local repo, which is done this way (rails being the folder where the repo is cloned, a level down from the Gemfile):

    gem 'rails',            :path => 'rails/railties'
    gem 'actionmailer',     :path => 'rails/actionmailer'
    gem 'actionpack',       :path => 'rails/actionpack'
    gem 'activerecord',     :path => 'rails/activerecord'
    gem 'activesupport',    :path => 'rails/activesupport'
    

    After defining the rails/railties .gemspec, you could also leave out some of those gems, and have bundler use the normally available versions from gemcutter etc.

提交回复
热议问题