1

I'm new to mac.

I'm mobile application engineer and developing a mobile app with rails API.

My mobile app can't fetch data from the Rails API.

I was told to use ifconfig, and put en0's IP to rails's address.

I did ifconfig en0 it shows

ether 5x:5x:ca:f6:0x:ax

What is rails's address? I was told to rewrite rails's address by using ifconfig.

My question is How to use iconfig with Rails API?

Cœur
  • 37,241
  • 25
  • 195
  • 267
sonicmario
  • 601
  • 8
  • 22

1 Answers1

0

ifconfig should have an output of multiple lines for multiple interfaces. Your local ip should be referred just below the ether mention. ( ether is your mac address not your IP).

Too find your IP search for something like this ( for home or generally small networks )

inet 192.168.x.x
dstrants
  • 7,423
  • 2
  • 19
  • 27
  • thanks, but I want to know is How to use iconfig withRails. – sonicmario Mar 09 '18 at 06:29
  • ah, sorry did not get the question right. So what do you need? Get your local IP through ruby? – dstrants Mar 09 '18 at 06:30
  • I can't fetch deta from rails API with react-native app. I was told to change settings of Rails by using iconfig. – sonicmario Mar 09 '18 at 06:32
  • You can get the address of `en0` (machines IP) using the commands referred [here](https://stackoverflow.com/questions/5029427/ruby-get-local-ip-nix), without using ifconfig. But I still don't know if I get the question right – dstrants Mar 09 '18 at 06:34
  • thanks a lot. I'll try your solution. My question is How to set my mobile application's address in my rails dev API? I' m new to rails so, I don't know how to set my mobile app's address to Rails API. – sonicmario Mar 09 '18 at 06:37