Ernest Gellner was both a philosopher and a social anthropologist. He believed that positivism was the correct philosophy, but the logical positivists had expressed it badly. Rather than being an analysis of how all knowledge is obtained, Gellner thought that positivism should be seen as a quasi-ethical principle of how one ought to obtain knowledge. This position is interesting but a bit hard to grasp. A few quotes may help to explain it. The first is from the essay "Gellner's Positivism" by Ian Jarvie (in The Social Philosophy of Ernest Gellner, eds. John Hall and Ian Jarvie):

As Gellner construes philosophy, it [...] should, among other things, be partly empirical: the facts of the world make a philosophical difference. The overwhelming fact of the modern world makes a decisive philosophical difference. Furthermore, the particular philosophy of the facts so scorned by the Oxford disciples of the later Wittgenstein, namely positivism, seems to Gellner the correct philosophy -- even if it was seldom properly worked out by those who adhered to it (e.g. the logical positivists). This last qualification merely points to the fact that Gellner is a positivist yes, but something of a positivist sui generis because modern positivisms are 'trite and scholastic'. (p. 524)

Gellner elaborates his position on the theory of knowledge in his book Legitimation of Belief, in the essay "Positivism against Hegelianism" (in his book Relativism and the Social Sciences; Gellner memorably concludes this essay by saying: "the positivists are right. For Hegelian reasons." p. 67) and in an article entitled "An ethic of cognition" (in his book Spectacles and Predicaments). In "An ethic of cognition" Gellner writes:

The key idea in empiricism is the sovereignty of experience, and above all the exclusive and sole sovereignty of experience, in cognitive matters. What seems a trite truism (we learn by experience) becomes an unbelievably daring, radical, destructive, and difficult doctrine if reformulated more strongly so as to say -- we learn in no other way. (p. 169)

In particular, Gellner sees positivism as a method that excludes knowledge obtained through divine revelation, such as from a holy text. As Jarvie notes, "The positivism to which Gellner gives almost unqualified approval is d'Holbach's Le systéme de la nature" (Op. cit., p. 523). D'Holbach's 1770 book is sometimes called the "Bible of atheism" and is a classic Enlightenment account of a materialistic description of the universe. Small wonder that Gellner sometimes called himself an "Enlightenment fundamentalist."

Gellner sees positivism as the denial of the kind of world-views offered by religion, world-views in which the True, the Good and Beautiful converge within a cosmic story that dispels all doubt. These ideological world-views are not exclusively religious -- other all-encompassing belief systems that combine knowledge with morality are also excluded by positivism:

So, the sheer distribution of faith and disbelief itself confirms the truth of faith. Only those devoid of Grace doubt the existence of God; only neurotic resisters doubt the insights of depth psychology; only class enemies fail to see the cogency of scientific historical materialism [...] (p. 166)

Gellner defines positivism, or empiricism, as the rejection of these ideological worlds -- of religion, Marxist historical materialism, and so on:

What is empiricism, in general? The rough but correct definition, i.e., the one which brings out what really matters about the doctrine, is also highly paradoxical. It runs approximately as follows: empiricism is the a priori exclusion of a certain class of possible worlds, namely those worlds which satisfy some very deep general moral yearnings, roughly indicated above. (p. 168)

As Jarvie noted, Gellner believed that empirical facts about the modern world make a difference to epistemology. In particular, the most important fact of this kind is what he called "the Big Divide":

The biggest, most conspicuous single fact about the human world is the Big Divide between what may roughly be called the industrial-scientific societies and the Rest. The former possess, for good or ill, enormous manipulative and predictive powers over nature (though not over social processes), endowing them with the means both of mass destruction and of mass affluence and leisure. The latter miserably scrape a precarious living by agriculture or even cruder methods. Their techniques for either feeding or killing people are slow, inefficient, and labour-intensive. (p. 175)

Thus, positivism should be formulated so that it takes into account the Big Divide:

The importance of original, Comtian positivism was that it combined an articulation of the model with a historico-sociological awareness of the Big Divide. The trite and scholastic nature of many twentieth-century formulations of positivism are a consequence of an interest restricted to the model alone. The empiricist story of how an individual accumulates information about the world, is only useful if treated as an account of how some societies (but some only) have learned to investigate nature, and so as a parable of the Big Divide. (pp. 175f)

Gellner's position is that any attempt to prove the correctness of positivism as a theory of knowledge by means of a purely logical argument is doomed to fail. There is no way to prove, by logical argument alone, to someone who believes in an ideological world-view that he is wrong:

What is important is the fact that we have no logical or independent way of proving that such a 'circular' world, or strictly speaking a world sustained by reasoning which seems circular to an outside and hostile critic (or outside and hence hostile), cannot exist. On the contrary: it could well exist. A world so constructed as to make its most important features manifest to the good, and obscured from the wicked, might well exist. Perhaps, indeed, it does exist: and perhaps this world is just such a world. There is nothing in the very least logically self-contradictory in such a supposition. It cannot be excluded by logic. And it cannot be excluded by fact either, for it is constructed precisely in a way such that all facts can be accommodated. (p. 166)

Positivism should be seen as a quasi-ethical principle about how one ought to think and obtain knowledge, and as a rejection of all-encompassing world-views that combine the True and the Good. One more quote from Ernest Gellner's essay "An ethic of cognition":