Attaching a rack to a wall like that is a really bad idea.
There is a much better method: A rack that stands on the floor, and just leans against the wall.
I have a nice wooden oak one that I bought many years ago when I lived in a studio condo.
I now use it in an attached garage.
Note that it is just leaning against the wall, not attached to anything.
I can't find it online right now, but here is a metal one that is of similar concept:
Amazon.com : gearup Lean Machine Gravity Rack, Red/Black : Indoor Bike Storage : Sports & Outdoors