views:

53

answers:

2

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 together with my app. We're using bundler, and the app is versioned with SVN.

What is the cleanest way to use my branch in the github fork of rails and share this across machines ?

One way would be this:

http://stackoverflow.com/questions/1972113/how-do-i-install-edge-rails

which would work, but doesn't feel clean enough, as we'd have to update the vendored version manually when the repo changes, and we'd have to check the git repo into svn.

I've tried variations of this in the Gemfile:

gem 'rails', '2.3.10', :git => 'git://github.com/traveliq/rails.git', :branch => 'tiq-fixes'
gem 'rails', '2.3.10', :git => 'git://github.com/traveliq/rails.git', :tag => 'v2.3.10'
gem 'rails', '2.3.10', :git => 'git://github.com/rails/rails.git', :tag => 'v2.3.10'

All of those initially work when running bundle install, but when starting the app, it can't find rails in the load path:

/home/mt/Development/config/boot.rb:57:in `require': no such file to load -- initializer (LoadError)
    from /home/mt/Development/config/boot.rb:57:in `load_initializer'
    from /home/mt/Development/config/boot.rb:117:in `run'
    from /home/mt/Development/config/boot.rb:11:in `boot!'
    from /home/mt/Development/config/boot.rb:130
    from script/console:2:in `re

My Gemfile.lock entries are like this:

GIT
  remote: git://github.com/traveliq/rails.git
  revision: 25139ac92cea5b17791d71359bc3ae2a5d526652
  branch: tiq-fixes
  specs:
    rails (2.3.10)

...

DEPENDENCIES

...

rails (= 2.3.10)!

A: 

Looks like at version 2.3.10, rails did not have .gemspec files for its components. Instead, each gemspec is specified in the corresponding Rakefile.

Otherwise you would use:

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

Further reference: http://gembundler.com/git.html

EDIT: That means that bundler requires a gemspec to be in place.

balu
Thanks for pointing me to the bundler git docs, didn't know there were more than the "getting started" docs. However, I'm still getting this error:Could not find gem 'actionpack (>= 0, runtime)' in git://github.com/traveliq/rails.git (at tiq-fixes).Source does not contain any versions of 'actionpack (>= 0, runtime)'
M.G.Palmer
Alright, I take it your answer means: Not possible out of the box with bundler and rails 2.3.x . But I guess I could add .gemspec files in my branch into the dependencies ?
M.G.Palmer
Yup. Just copy it from the Rakefile in the gem directory.
balu
Would be nice if you'd vote me up and mark as correct answer. :)
balu