0

Can't find a solution for this on stack.

I'm using ubuntu server,

$php app/console generate:bundle --namespace=WMDN/FirstBundle --format=yml

goes fine until :

Generating the bundle code: OK
Checking that the bundle is autoloaded: FAILED
Confirm automatic update of your Kernel [yes]? yes
Enabling the bundle inside the Kernel: OK
Confirm automatic update of the Routing [yes]? yes
Importing the bundle routing resource: OK


 The command was not able to configure everything automatically.
You must do the following changes manually.


- Edit the composer.json file and register the bundle
namespace in the "autoload" section:

I thought it was permissions, and set the whole dir to 775 and made sure owner was good. I thought it was outdated bug for symfony and deleted whole dir, and got 2.4.4

I'm following a tutorial and their bundle generates just fine and I'd like mine to do it as well.

Why can it not autoload? My Namespace should be good to use. I cannot figure it out. I have composer installed.

Following this tutorial series : http://www.youtube.com/watch?v=GIcY5YYfZ14 and I'd really like to get my first bundle created so I may continue.

In conclusion, what are the reasons a bundle would fail autoload?

Theodore Enderby
  • 622
  • 1
  • 6
  • 19
  • Did you install composer? – phpisuber01 May 23 '14 at 14:20
  • As it says in my post I have composer installed. Are there any commands I should run in composer first? I may be confused I installed composer before setting up symfony. Do I have to install it in my symfony dir as well? – Theodore Enderby May 23 '14 at 14:23
  • I would give a `php composer.phar update` a whirl. – phpisuber01 May 23 '14 at 14:27
  • I installed composer and updated it in my symfony root folder. I deleted my previous bundle and cleared my cache. I checked localhost/config.php and there are no errors. I tried to generate a bundle and recieved the same error – Theodore Enderby May 23 '14 at 14:35
  • Try adding --dir=src to your command. The error about not being able to update composer.json is puzzling since it does not need updating it in the first place. If --dir does not help then just run app/console generate:bundle and follow the prompts. – Cerad May 23 '14 at 14:47
  • Cerad, I think what you said was the problem, but I handled it differntly. With the above command in my post, during dialogue I the dir was set to `/var/www/html/learn/app/cache/src/` and I told it `/var/www/html/learn/src/` and it went through all the way. So this was the solution for me I'll give you answer credits if you want. – Theodore Enderby May 23 '14 at 14:52

1 Answers1

2

Per to comments, solution was to set the --src parameter correctly.

Cerad
  • 48,157
  • 8
  • 90
  • 92