there are some things you can do with just your bodyweight and using stuff like walls, chairs and other things youd have easy access that could help you get muscle. of course it wouldnt be nearly as efficient as a real gym, but its possible
weights are just resistance training, you're stopping the weights from falling to the ground. You just need to stop something heavy or something that can cause resistance from doing what ever you want it to do. you can spend like $30 on a resistance band and get a better workout than buying weights.