Tosefta Shabbos, Chapter 7:
“These things are “from the ways of the Emorim” (i.e., behavior of idolaters): one who cuts his hair “koomi” (i.e., like the idolaters), and one who makes a plait (locks worn by Roman or Greek youth or upper classes) and offers it to the gods, one who raises her child between the dead, one who ties a cushion to his hip (a superstitious custom), or a red string to his finger, and one who appoints and throws rocks to the sea or the river, these are idolatrous behaviors; one who and claps and dances to the fire, this is idolatrous behavior.
Maimonides’ “Guide for the Perplexed” (Book III, Chap. 37):
“The same idolatry and superstitious performances which, in your belief, keep certain misfortunes far from you, will cause those very misfortunes to befall you. “I will also send wild beasts among you” (Lev. xxvi.22), “I will also send the teeth of wild beasts upon them, with the poison of those that creep in dust.” (Deut. xxxii. 24). “The fruit of thy land, and all thy labors, shall a nation, which thou knowest not, eat up.” (ibid. xxviii. 33). “Thou shalt plant vineyards and dress them, but shalt neither drink of the wine nor gather the grapes, etc. Thou shalt have olive trees throughout all thy coasts, but thou shalt not anoint thyself with the oil.” (Dent. xxviii. 39,40). In short, in spite of the schemes of idolaters to support and firmly establish their doctrine, and to make people believe that by idolatry certain misfortunes could be averted and certain benefits gained, worship of idols will, on the contrary, as is stated in “the words of the covenant” prevent the advantages and bring the troubles.”
“Our Sages say distinctly, “whatever is used as medicine” does not come under the law of “the ways of the Emorite”: for they hold that only such cures as are recommended by reason are permitted, and other cures are prohibited. When, therefore, the dictum was quoted: “a tree that casts off its fruit may be laden with stone or dyed with red color”, the following objection was raised: “The loading of the tree with stones may be justified on the plea that it serves to weaken the strength of the tree, but why should it be permitted to dye the tree with red color?” This question shows that the dyeing of the tree with red color, and all similar things which are not explained by analogy from nature, are prohibited as “ways of the Amorite!”
(from Mesorah.org)