# Server in China can't reach rubygems.org so install fails

**URL:** https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329
**Category:** Self-hosting
**Created:** [10 februari 2016 om 09:37 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329 "2016-02-10T09:37:43Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 09:37 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/1 "2016-02-10T09:37:43Z")

</div>

Install being given today  
FAILED  
--------------------  
RuntimeError: cd /var/www/discourse && su discourse -c ‘bundle install --deployment --verbose --without test --without development’ failed with return #\<Process::Status: pid 343 exit 7\>  
Location of failure: /pups/lib/pups/exec\_command.rb:105:in `spawn’  
exec failed with the params {“cd”=\>“$home”, “hook”=\>“bundle\_exec”, “cmd”=\>[“su discourse -c ‘bundle install --deployment --verbose --without test --without development’”, “su discourse -c ‘bundle exec rake db:migrate’”, “su discourse -c ‘bundle exec rake assets:precompile’”]}  
b9d7f127683db22ead5399eb31aebf6d505c0e092514327234ff3e9f2ba82a19  
\*\* FAILED TO BOOTSTRAP \*\* please scroll up and look for earlier error messages, there may be more than one

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [10 februari 2016 om 09:45 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/2 "2016-02-10T09:45:52Z")

</div>

Mmmhmm… and what do the earlier error messages look like?

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 09:46 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/3 "2016-02-10T09:46:38Z")

</div>

That’s all the error log

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 09:48 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/5 "2016-02-10T09:48:59Z")

</div>

No previous problems, is today updated a bit, then can not rebuild or install

---

<div class="post-metadata">

### Author: ![PabloC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pabloc/32/49633_2.png) [@PabloC](https://meta.discourse.org/u/PabloC)
#### Post date: [10 februari 2016 om 10:04 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/7 "2016-02-10T10:04:41Z")

</div>

What are your hosting specs? how much memory?

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 10:13 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/8 "2016-02-10T10:13:02Z")

</div>

CPU: 2 nuclear  
Memory: 4096 MB

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 10:14 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/9 "2016-02-10T10:14:12Z")

</div>

There is an error message on the front

```
HTTP 200 OK
Query List: []
Could not find email_reply_trimmer-0.0.6 in any of the sources

```

---

<div class="post-metadata">

### Author: ![PabloC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pabloc/32/49633_2.png) [@PabloC](https://meta.discourse.org/u/PabloC)
#### Post date: [10 februari 2016 om 10:24 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/10 "2016-02-10T10:24:09Z")

</div>

it will help if we can see the full log.

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 11:54 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/11 "2016-02-10T11:54:36Z")

</div>

```
HTTP 200 OK
Query List: []
Could not find email_reply_trimmer-0.0.6 in any of the sources

I, [2016-02-10T11:52:36.804974 #38] INFO -- : Terminating async processes
I, [2016-02-10T11:52:36.805054 #38] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main pid: 108
I, [2016-02-10T11:52:36.805132 #38] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 236
2016-02-10 11:52:36 UTC [108-2] LOG: received fast shutdown request
2016-02-10 11:52:36 UTC [108-3] LOG: aborting any active transactions
2016-02-10 11:52:36 UTC [115-2] LOG: autovacuum launcher shutting down
2016-02-10 11:52:36 UTC [112-1] LOG: shutting down
236:signal-handler (1455105156) Received SIGTERM scheduling shutdown...
236:M 10 Feb 11:52:36.881 # User requested shutdown...
236:M 10 Feb 11:52:36.882 * Saving the final RDB snapshot before exiting.
236:M 10 Feb 11:52:36.886 * DB saved on disk
236:M 10 Feb 11:52:36.886 # Redis is now ready to exit, bye bye...
2016-02-10 11:52:36 UTC [112-2] LOG: database system is shut down

```

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [10 februari 2016 om 15:28 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/12 "2016-02-10T15:28:28Z")

</div>

What happens when you run “`gem install email_reply_trimmer`” from inside the container?

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 16:08 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/13 "2016-02-10T16:08:16Z")

</div>

```
An error occurred while installing email_reply_trimmer (0.0.6), and Bundler
cannot continue.
Make sure that `gem install email_reply_trimmer -v '0.0.6'` succeeds before
bundling.

FAILED
--------------------
RuntimeError: cd /var/www/discourse && su discourse -c 'bundle install --deployment --verbose --without test --without development' failed with return #<Process::Status: pid 296 exit 5>
Location of failure: /pups/lib/pups/exec_command.rb:105:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"bundle_exec", "cmd"=>["su discourse -c 'bundle install --deployment --verbose --without test --without development'", "su discourse -c 'bundle exec rake db:migrate'", "su discourse -c 'bundle exec rake assets:precompile'"]}
d1702bba1d88ff0da3097b76755409118974ef56618dbf4673348d5a6e812967
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [10 februari 2016 om 16:15 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/14 "2016-02-10T16:15:08Z")

</div>

What happens when you run “`gem install email_reply_trimmer -v '0.0.6'`” then?

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 16:43 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/15 "2016-02-10T16:43:26Z")

</div>

```plaintext
I, [2016-02-10T16:32:05.094803 #38] INFO -- : Purging temp files
Bundling assets
Compressing Javascript and Generating Source Maps

I, [2016-02-10T16:32:05.104034 #38] INFO -- : File > /usr/local/bin/discourse chmod: +x
I, [2016-02-10T16:32:05.110299 #38] INFO -- : File > /usr/local/bin/rails chmod: +x
I, [2016-02-10T16:32:05.116701 #38] INFO -- : File > /usr/local/bin/rake chmod: +x
I, [2016-02-10T16:32:05.122977 #38] INFO -- : File > /etc/update-motd.d/10-web chmod: +x
I, [2016-02-10T16:32:05.126559 #38] INFO -- : File > /etc/logrotate.d/rails chmod: 
I, [2016-02-10T16:32:05.130444 #38] INFO -- : File > /etc/logrotate.d/nginx chmod: 
I, [2016-02-10T16:32:05.137048 #38] INFO -- : File > /etc/runit/1.d/00-ensure-links chmod: +x
I, [2016-02-10T16:32:05.138040 #38] INFO -- : Replacing (?-mix:server.+{) with limit_req_zone $binary_remote_addr zone=flood:10m rate=$reqs_per_secondr/s;
limit_req_zone $binary_remote_addr zone=bot:10m rate=$reqs_per_minuter/m;
limit_req_status 429;
server {
 in /etc/nginx/conf.d/discourse.conf
I, [2016-02-10T16:32:05.138665 #38] INFO -- : Replacing (?-mix:location @discourse {) with location @discourse {
  limit_req zone=flood burst=$burst_per_second nodelay;
  limit_req zone=bot burst=$burst_per_minute nodelay; in /etc/nginx/conf.d/discourse.conf
I, [2016-02-10T16:32:05.139954 #38] INFO -- : > echo "Beginning of custom commands"
I, [2016-02-10T16:32:05.142535 #38] INFO -- : Beginning of custom commands

I, [2016-02-10T16:32:05.143269 #38] INFO -- : > echo "End of custom commands"
I, [2016-02-10T16:32:05.145816 #38] INFO -- : End of custom commands

I, [2016-02-10T16:32:05.146430 #38] INFO -- : > awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'
awk: fatal: cannot open file `/root/.ssh/authorized_keys' for reading (No such file or directory)
I, [2016-02-10T16:32:05.152361 #38] INFO -- : Authorized SSH keys for this container:

I, [2016-02-10T16:32:05.152624 #38] INFO -- : Terminating async processes
I, [2016-02-10T16:32:05.152758 #38] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main pid: 67
I, [2016-02-10T16:32:05.152857 #38] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 196
2016-02-10 16:32:05 UTC [67-2] LOG: received fast shutdown request
2016-02-10 16:32:05 UTC [67-3] LOG: aborting any active transactions
2016-02-10 16:32:05 UTC [74-2] LOG: autovacuum launcher shutting down
196:signal-handler (1455121925) Received SIGTERM scheduling shutdown...
2016-02-10 16:32:05 UTC [71-1] LOG: shutting down
196:M 10 Feb 16:32:05.208 # User requested shutdown...
196:M 10 Feb 16:32:05.208 * Saving the final RDB snapshot before exiting.
196:M 10 Feb 16:32:05.213 * DB saved on disk
196:M 10 Feb 16:32:05.213 # Redis is now ready to exit, bye bye...
2016-02-10 16:32:05 UTC [71-2] LOG: database system is shut down
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one

```

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 16:52 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/16 "2016-02-10T16:52:39Z")

</div>

```
An error occurred while installing omniauth-google-oauth2 (0.3.1), and Bundler
cannot continue.
Make sure that `gem install omniauth-google-oauth2 -v '0.3.1'` succeeds before
bundling.

```

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [10 februari 2016 om 16:54 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/17 "2016-02-10T16:54:04Z")

</div>

Ok so it’s not related to that specific gem. Where is your server located? Is it in China by any chances? Seems like it’s having issues connecting to [rubygems.org](http://rubygems.org)…

---

<div class="post-metadata">

### Author: ![saluzi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saluzi/32/77568_2.png) [@saluzi](https://meta.discourse.org/u/saluzi)
#### Post date: [10 februari 2016 om 17:03 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/18 "2016-02-10T17:03:53Z")

</div>

in China 🙂

---

<div class="post-metadata">

### Author: ![webeindustry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/webeindustry/32/53973_2.png) [@webeindustry](https://meta.discourse.org/u/webeindustry)
#### Post date: [10 februari 2016 om 17:50 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/19 "2016-02-10T17:50:05Z")

</div>

That’s interesting. I guess traffic has been blocked from the whole country to rubygems? It would seem using a proxy is the solution.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [10 februari 2016 om 17:55 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/20 "2016-02-10T17:55:19Z")

</div>

When on china you need to use:

`source https://ruby.taobao.org/`

instead of

`source https://rubygems.org/`

in your Gemfile.

PS.: I’m never been to China but read about this on StackOverflow.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8 juni 2024 om 12:45 UTC](https://meta.discourse.org/t/server-in-china-cant-reach-rubygems-org-so-install-fails/39329/22 "2024-06-08T12:45:48Z")

</div>

This topic was automatically closed after 3041 days. New replies are no longer allowed.
