Quickly 'move' gems to another server

Angelegt von andi Fri, 30 Jul 2010 02:38:00 GMT

For example when moving from one to another server, the task to install all gems rails applications on the new server will need.

First get a list of all gems one the old server, with:

 

gem list

 

 

, then use a script like this one to remove version numbers from the script, and generate a list of gems...

 

 

	@output = ""

	File.open('gems').each_line do |l|

	 @output << l.gsub(/\(.+\)/,'').strip + ' '

	end

 

 

and pass it to gem install ...

Obviously this script would isn't that cool - it lacks support for multiple version numbers - and after all doesn't take care of the right version numbers at all.

For my todays (tonights) purpose that was enough, but if i find the time, i'll rewrite it to take the gem list's output, and install all the gems with all the right versions on the new server...

Trackbacks

Verwenden Sie den folgenden Link zur Rückverlinkung von Ihrer eigenen Seite:
http://praktikanten.brueckenschlaeger.org/trackbacks?article_id=142

Leave a comment

Comments