I am working on a project and I want to connect more than two laptops to a Rails database locally on my laptop. So that whenever they run the Rails app and submit the answer, the info will be on their laptop as well as mine. I know this can be done with PHP, but I am trying to do it with rails. I am trying to connect the database to at most 7 laptops with no internet connection. As I said, it will be locally, they will run the same rails code on their laptops and their data would be saved to the same database. The laptops can connect by an Ethernet cable to help them connect. If you can help, thank you so much.
Asked
Active
Viewed 40 times
1 Answers
0
If I understand correctly.
- All the laptops need to be in the same network.
- Make sure the one hosting the db allows remote connections (look out for firewall rules).
- Find out the ip assigned to the db laptop
- Configure database.yml in each of the other laptops to point to the ip of the laptop with the database with the correct database name and pwd vs the defaul localhost.

s1mpl3
- 1,456
- 1
- 10
- 14
-
there will be no internet connection at that place, If I can connect them at home, turn them off,then turn them back on when I arrive, but they will not be connected to the internet. Will they still share the same database? They can connect to an Ethernet cable, will that help? – T.Aloufi Feb 02 '18 at 02:37
-
Wifi or Ethernet would work but they have to be in the same networks, meaning that from one laptop you should be able to ping the other. The network can be run without internet access. – s1mpl3 Feb 02 '18 at 07:22
-
Ok, Then your understanding is correct. How will I be able to do it? – T.Aloufi Feb 02 '18 at 17:08
-
That is a completely different questions but in a Mac you go to Systems/Network and in windows use ipconfig in the prompt of in your network config – s1mpl3 Feb 02 '18 at 19:19
-
Can you provide a link that provides more information on that? That would be helpful – T.Aloufi Feb 03 '18 at 17:37