使用 Genymotion 作为 Android Emulator 时,本地调用 Rails 作为 API 后台的 IP 地址,
应该使用 10.0.3.2 来代替 localhost
同时,Rails 服务启动的时候需要使用
rails s -b 0.0.0.0
使用 Android Emulator 相当于是局域网里的另一台机器来访问 Rails 服务,而在 Rails 4.2 以后修改了 Rails Server 默认的的 Host, 所以要使用上面的命令来让 Android Emulator 可以访问 Rails Service,同时需要注意使用防火墙策略来只让受信任的机器访问你的开发服务器。