Re: Sinatrarb connection failed when running from Android emulator

83 views
Skip to first unread message

Patricio Mac Adden

unread,
May 15, 2013, 12:55:43 PM5/15/13
to sina...@googlegroups.com
That's because you are not running sinatra inside the emulator. Try using the IP address of your machine instead of localhost.



El 15/05/2013, a las 12:26, Gap22 <charlo...@gmail.com> escribió:

I am trying to point to: http://localhost:4567 but receive error message:

AsyncTask #2 Service client error with message I/O error: Connection to http://localhost:4567 refused; nested exception is org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:4567 refused

Not sure why. It works when connecting from xcode. All I had to do was point the environment to http://localhost:4567

Thanks!



--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinatrarb+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gap22

unread,
May 23, 2013, 3:11:06 PM5/23/13
to sina...@googlegroups.com
Hi Patricio,

Thanks for the reply. I tried to point to: http://100.100.0.0:4567 but I still get a "Connect: Connection refused". It returns a 503 - Service Unavailable. I am connected to a proxy as well. Does it not work well with proxies?

Patricio Mac Adden

unread,
May 23, 2013, 3:23:22 PM5/23/13
to sina...@googlegroups.com
I'm not sure if 100.100.0.0 is the address of your development machine, seems like your network address (or an A class ip address).

Try running the sinatra application passing the -o option with the ip, like this:

ruby hi.rb -o <IP_ADDRESS>

You can get your ipadress using ipconfig in windows or ifconfig in linux/mac.

Other thing I can imagine is that your AndroidManifest.xml file does not have the INTERNET permission.

You can try to access the application from your local development machine.

Can you give me more info?

Gap22

unread,
May 23, 2013, 3:45:13 PM5/23/13
to sina...@googlegroups.com
Hi,

That wasn't a real ip number. that's why it was italicized ;) sorry for the confusion

I tried it with the -o <ipAddress> and that worked. Why would that be? Logcat displays the same URL being used from using the -o <ip> and not using it.

Thank you!!

Gap22

unread,
May 23, 2013, 4:33:35 PM5/23/13
to sina...@googlegroups.com
Running from: ruby hi.rb -o <IP_ADDRESS> works on my android app BUT doesn't work on my iOS app. And vice versa, ruby hi.rb works on iOS but not on my android app. Do you happen to know what the difference is?? Between those two?

Patricio Mac Adden

unread,
May 23, 2013, 9:57:31 PM5/23/13
to sina...@googlegroups.com
Nope, I can't help you with that one. I said that about android manifest file because I'm developing some android apps, but I can't help you with ios. Sorry!

Gap22

unread,
May 24, 2013, 12:19:54 PM5/24/13
to sina...@googlegroups.com
This is an android issue, I was just comparing differences. But running the android as: ruby hi.rb -o <IP_ADDRESS> works. Why would that work and not having it set to point to my <IP ADDRESS>  in code work? How would I make it work instead of using -o?
Reply all
Reply to author
Forward
0 new messages