As those of us living and working in China know,sometimes the internet can be troublesome . At some point last month, installing gems from the command line - something we do almost every day if not many times a day - no longer worked seamlessly. For whatever unknown reason, the rubygems production server is currently inaccessible or extremely unstable from within mainland China.
In discussions with the gzruby group, we tried to find workable solutions to this problem. One idea is to set up a reverse proxy. This solves the issue, but installing gems is still really slow. Another proposal is to set up a mirror, as described in this post by sachin. But rather than set up a local server, why not set up the proxy somewhere the greater community can use it.
Thus, gems.gzruby.org was born.
Add the following line to your Gemfile:
And change your ~/.gemrc to something like this:
--- :sources: - http://gems.gzruby.org/ gem: --no-rdoc --no-ri
The app itself is a simple rack app that either serves a cached version of the gem, or fetches the gem from production.cf.rubygems.org. So the server on which you install must have access to this address.
If you already have a rails server running passenger on any VPS outside of china, setup is very easy. Simply clone the project into a new directory, and add a config to apache or nginx just as you would for any rails app.