How much time do I need to give to learning grammar rules versus vocabulary while studying German, or is it possible to speak a foreign language without needing to learn grammar rules?
German vocabulary and grammar are tightly related, which makes it quite impossible to learn a basic German vocabulary without at the same time also learning and understanding the basic rules of German grammar.
If you follow standard curriculums, as a beginning German language student you would find yourself spending much more time initially learning German grammar rules than you will learning German nouns, verbs, and other grammatical parts of speech in vocabulary building. But, by so doing you will be able learn to speak, read, and write coherent, grammatically correct, basic German sentences with a vocabulary of as little as 500-600 words, including basic nouns, verbs, pronouns, prepositions, adverbs, and adjectives.
Knowing German grammar rules is absolutely essential to the study of the German language.
If you are a beginning student I would suggest that initially you should look forward to spending up to 30% of your study time in vocabulary building, but then the remainder of your available study time should be spent in learning more and more of the German grammar rules.
The Berlitz book German for Dummies is a tourist-oriented book that takes the beginning student gently by the hand in teaching German vocabulary and grammar rules needed for travel in Germany. For less tourist-oriented students, students who are interested in both learning and using the German language and its grammar, then I believe that Intermediate German for Dummies is a much more useful text.
However, all that being said a more direct answer to your question is that one can easily enough be able to speak a foreign language without having to learn the grammar of that language.
That answer lies in the use of what are called "phrasebooks". Phrasebooks are collections of words and phrases in the source language that are translated into the target language, and then using the alphabet of the source language, that translation is then transliterated into the sounds of the foreign language.
I have in my hand right now an example of such a phrasebook. It's a copy of a Russian-to-English phrasebook, one intended for the use of Russians travelling to England or other English-speaking countries. Like any phrasebook, it uses the source language's Cyrillic alphabet and it's sounds for the transliterated pronunciation of English words and phrases. For example, my user name in this forum, "К. Келлогг Смытф" (K. Kellogg-Smith) is easily pronounced by Russian speakers, whereas the English translation is not so easily pronounced; the Russian language does not have the English "th" sound.
The advantage of using a language phrasebook is that one can learn to speak a target language without having to learn the grammar of the target language.
Language phrasebooks are available in major bookstores for most major languages e.g., French, German, Italian, and Spanish. They can also be ordered on Amazon.com under the category "Books", where you will find a number of phrasebooks for the German language there. You can even look into the contents of some of Amazon's German phrasebook offerings, such as the one titled 1001 Easy German Phrases.
Finally, I'd like to point out that the disadvantage of using a phrasebook is that even if the the user speaks the foreign language word, phrase, or sentence very correctly, the user will most likely not be able to understand the spoken return answer in the foreign language. In such cases the phrasebook commonly exchanges hands, with the user pointing a finger at the printed question and its target language translation, the listener looking for (and perhaps finding) an answer in the target language, then with his/her finger pointing to the answer hands the phrasebook back to the user -- with a smile.
Note: this is just my personal opinion and may not apply to everyone.
I found that prioritizing grammar works quite well. If you know the grammar, you can construct any sentence (even if your vocabulary is too limited to convey exactly what you want to say) and understand what is going on in sentences spoken by others (even if you do not know what they are saying). After all, you can always use a dictionary. IMO, this is especially important in German, where word order can be confusing at first. I find that if you learn the grammar quickly, you can then improve your vocabulary at whatever pace you feel comfortable with, knowing that as you pick up new words, you will be able to use them however you want. It also means that you can learn new vocabulary by listening to others and inferring from context, which will be difficult if you do not understand why a sentence was constructed the way it was.
As of writing this, my grammar is at quite a high level but my vocabulary is rather limited. Despite this, I managed to pass the C1 test, probably because my language was accurate and I knew the correct word order when I was talking and writing.
That being said, do not simply forget to learn and revise your vocabulary, as good grammar alone will not be good enough to express yourself.
There is no recommended ratio for the time you should spend on vocabulary versus the time you should spend on grammar. You need both. And you need some vocabulary to start with, since you need vocabulary to read and create example phrases that use the grammatical rules you are learning.
If you don't know much about German yet, try to find a native speaker of German (or someone who speaks it very well) and do a "language deconstruction". See the question Additional sentences for language deconstruction and the links you find there. This will give you an idea of some of the grammatical features of the German language.
You can then still decide whether you want to learn German (unless there is an important reason why you really need to learn it).
If you want to go through with it, try to find self-study materials, e.g. traditional self-study courses such those by Assimil, Teach Yourself, etc. You can also try online materials, such as the German course by DuoLingo. Traditional self-study courses such as Assimil introduce grammar gradually: the lessons focus on communicative situations, which introduce both vocabulary and grammar. If you find that you need additional grammar exercises, you can still get additional materials.
If you use a spaced repetition system such as Anki, you can integrate grammar learning with vocabulary learning, as I suggested here, i.e. by turning sentences that use specific grammatical features into cloze tests.
The technique described above (cloze tests) will lead to implicit learning of grammar rules. Studying grammar rules from grammar books is a form of learning that will increase your explicit knowledge of grammar rules. However, as the abstract of the article Implicit and Explicit Knowledge About Language by Nick C. Ellis points out:
From various divisions of cognitive neuroscience we know that implicit and explicit learning are distinct processes, that humans have separate implicit and explicit memory systems, that there are different types of knowledge of and about language, that these are stored in different areas of the brain, and that different educational experiences generate different types of knowledge.
Some linguists have argued that explicit knowledge does not transfer well to implicit knowledge (which you need when using the language) or that it does not transfer at all. Some linguists take a more moderate position (see interface position on Wikipedia).