My experience while deploying a ROR app to Amazon China

I have followed the following blogs to deploy my Ruby On Rails application on Amazon EC2 :-

But I have also faced some issues while deploying. So here are the some of the work arounds which I found while deploying Ruby On Rails app in Amazon China.

Issue #1

gem install bundler
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate . . .

Errno::ECONNRESET: Connection reset by peer bundler

And when I googled about it . . . I found the following. https://rubygems.org is blocking by china great firewall.
After googling a bit more I came to know that we can use a mirror for ruby gems.
https://ruby.taobao.org/index_en.html

gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***

https://ruby.taobao.org
# Ensure it only has ruby.taobao.org
$ gem install bundler

and it worked like charm.

Issue #2

ERROR 2002 (HY000): Can't connect to local MySQL server through socket

I followed up with this post http://stackoverflow.com/questions/19765290/error-failed-to-build-gem-native-extension-error-installing-mysql2
Also, removed the "socket: /tmp/mysql.sock" from database.yml

Issues #3

ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime

As we know Javascript Runtime is use by Rails Asset Pipeline. So, we had to install it and we installed it via nodeJS.

$ sudo apt-get install nodejs

No comments

Powered by Blogger.