Class GeoIp2\Database\Reader used in service ‘31_GeoIp2_Database_Reader’ not found or is not instantiable

Notice: This thread is very old.
alnux
Member | 106
+
0
-

Hi there im using nette 2.3.1 and i have this exception that on 2.7 i havent have

Nette\DI\ServiceCreationException

Class GeoIp2\Database\Reader used in service '31_GeoIp2_Database_Reader' not found or is not instantiable.

my config service is like

services:
	# Extensions without compatibility with nette, them like services
	- GeoIp2\Database\Reader('%appDir%/common/geoip/GeoLite2-Country.mmdb')

I dont know what is worng

alnux
Member | 106
+
0
-

Solved.
In my case, and if this happens the composer didnt generated the autoload. so you can regenerate it with the command

composer dump-autoload
David Kudera
Member | 450
+
0
-

I suggest using psr4 autoloader, then you don't need to rebuild autoloader on your own. Downside is that it's little bit slower, so on production you can use composer install -o which will create “files” autoloader from all other types (psr4, psr0).

Last edited by David Kudera (2015-04-30 18:28)