How do I setup a rails project to use an edge source tree (not an installed gem) version of rails
I would like the rails 3.0 source tree in my project so I can use patches, etc. I don' want to freeze rails. I would like to be abl开发者_高级运维e to pull updates from the main repo too. How do I accomplish this?
In particular the getting started guide, has me confused with
As the root user:
# gem install bundler
# bundle install
If I install the bundled gems to my system then I'm not really running with the vendor/rails source tree. Do rails developers really edit-test-edit-test and then install gems to their system before trying out patches on an actual app?
--- Update ---
$ cd ~myapp/vendor/rails
$ bundler install
There are a bunch of gems in vendor/rails/vendor/cache. When I
$ cd ~/myapp
$ bundler install
... Could not find gem 'rails (= 3.0.0.beta1, runtime)' in any of the sources. (Bundler::GemNotFound)
How do I tell my app to get its gems with the bundled rails gems in vendor/rails/vendor/cache?
gem "rails", :git => "git://github.com/rails/rails.git"
as per ASCIIcasts Episode 201.
After much screwing around, this is how to setup edge rails 3.0 beta.
mkdir -p myapp/vendor
cd myapp
git init
git submodule add git://github.com/rails/rails.git vendor/rails
git commit -m "Frozen Rails Edge as submodule"
ruby -r'rubygems' vendor/rails/railties/bin/rails .
Then edit myapp/Gemfile and change
gem 'rails', '3.0.0.beta1'
to this
gem 'rails', '3.0.0.beta1', :path => 'vendor/rails'
Finally, in myapp/
bundle check
bundle install
I found that any changes made to the rails source in vendor/rails will appear next time they load. There is no need to 'bundle install' after applying a patch.
References: 1 2 3 4
精彩评论