I've posted a couple other questions during this process, but I have a better idea of what I'm trying to do so I thought I'd ask about that.
I've inherited a Rails 2.2.2 application, which is currently running in production form on a server I have access to. I'm trying to port that application over to my server, version control, etc. I first tried to copy over the source code and get it running under Rails 3 and the latest versions of gems, but that's proved to be much more difficult than I thought it would be. It seems like the best solution is to simply use the same version of Rails and other gems that the current system is using, and port over the application as-is.
So I'm wondering what the best way to do that is? I can put the source in my version control system and set up Capistrano and Passenger the same way as they are now. The issue is getting all the gems over in the same version. I've heard about freezing Rails and freezing gems, but a lot of the tutorials on it look a bit outdated. Is it safe to freeze the gems on the currently-running production server, or should I just get a list of the gems and their versions and manually install them all on the new server I'm porting over to?
Edit: I followed tadman's suggestion and set up a Gemfile with all the gems and latest versions installed on the production server, but now I've gotten into a versioning mess with those, for example:
Bundler could not find compatible versions for gem "ruby2ruby":
In Gemfile:
merb-action-args (= 1.0.8.1) depends on
ruby2ruby (>= 1.1.9)
ambition (= 0.5.4) depends on
ruby2ruby (1.1.8)
The production server has sometimes up to 4 versions of the same gem installed, but Bundler seems to only want to handle one version of each. Is there an easy way to solve a situation like this, or is it back to looking into freezing gems in production?
Edit 2: I wound up removing versions from all gems except for rails and doing bundle install
. So far, it seems to be working even though all the versions aren't matched exactly.