nathan
nathan

Reputation: 1506

Using RestKit with local server

I've got RestKit in my iPhone app interacting with a Rails app on Heroku, but RestKit won't seem to work with the Rails app running locally on my machine. Here's the output in my iPhone app:

Fail: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." NSErrorFailingURLKey=http://0.0.0.0:3000/users/1.json, NSUnderlyingError=0x2a9690 "Could not connect to the server."}

I've done all the sanity checks. http://0.0.0.0:3000/users/1.json returns a JSON object in my browser and when I change the root URL to the app on Heroku, RestKit works fine.

Is there something I'm missing? How do I get RestKit to work with the local version of my app?

Upvotes: 1

Views: 244

Answers (1)

nathan
nathan

Reputation: 1506

This was a dumb error on my part. An app running on a device obviously can't access a rails app running on localhost.

This works fine in the simulator or when pointed to a production server.

Upvotes: 1

Related Questions