Question: I am an amateur bass guitar player. At some point I decided to do something about my lack of theory knowledge.

Now I know a few basic scales and can read sheet music in simple keys (from zero to one to two flats/sharps). I understand in general how chords are built on degrees of the scale and know some basic ones. I understand what V/vii etc chord means. I know where notes on the fretboard are located.

But when it comes to real practice with a band, I'm completely lost. I can't seem to apply this knowledge in the process and reduce to catching roots by ear and playing cliches which often don't match the key and chord, and as I discover it I start alternating them nearly randomly (with the scale in mind if I'm happy enough to see it on the fretboard) until it sounds OK. 

**How do I bridge the gap between the theory and practice and start using the knowledge**?

Answer: 
@GeneralNuisance gets right to the point: music theory is a set of tools to describe music. But, would suggest a different emphasis on how to apply the theory in practice. 

I say **first analyze the music you play and listen to**, and become skilled at identifying musical elements. Analyze the connection between the musical elements you can identify and the expressive effect they have. Be cautious about using theory to support the creative process to avoid theory becoming 'the rules of music.' The worst would be misapplying the theory you learn using isolated theory concepts in the wrong context. You might find something innovative... but you might also botch things up. I think it's better to take inspiration from your analysis of real music.

Also, don't mistake theory books for performance method or songwriting books. Theory books will tell **what** to name things. Theory will also explain **why** things work. Ex: the resolution of dissonance/tension gives a forward impulse to music. Method books will show you **how** to do things. Ex: play the chord root on the first beat of a bar in a walking bass line. Theory doesn't tell me to do that. A method book describing the style tells me. But, notice how we can only get the sentence in the method, by understanding the theory terms: chord, root, first beat, and bar. 

Theory can illuminate the **why?** in the walking bass example. The root is played on beat one, because it most clearly identifies the chord and helps reinforce the meter. An approach tone is often played on beat 4 (4/4 meter) because a non-chord tone resolving by step to beat one of the next bar give the music forward momentum. Now that we have some musical context we can try to get creative with the application of theory: if the root on beat one is stable, maybe a rest on beat one and hitting the root on beat two an agitated or crazy feel. Try it and then analyze the result.
The funny thing is, it's a lot easier to understand music theory than it is to understand how music theory will help your playing. It follows that spending time understanding the theory is time better spent than time trying to understand how it's helping.

When you're with the band, just put theory out of your mind completely. If you have to think about it, then you're not ready to use it anyway, and it just clogs up what should be an enjoyable an creative endeavour.

Remember that music theory comes from how music is practised, not the other way round. It's far more valuable to notice that C, E and G sound great over C major chords, and that adding a B to that sounds markedly different to adding a Bb, even though they both work (depending on the context). The fact that you're then using C Ionian or C Mixolydian (which differ by one note, namely B/Bb) is only a way to describe what your ears have worked out already.

Play when you're playing, study theory when you're studying, and trust that they will indeed converge and enrich each other.