Skip to content

Deploy to heroku fails #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fiunchinho opened this issue Mar 14, 2017 · 2 comments
Closed

Deploy to heroku fails #504

fiunchinho opened this issue Mar 14, 2017 · 2 comments

Comments

@fiunchinho
Copy link

Yesterday, this was working fine, but today I get the following error when trying to deploy to Heroku

ATTENTION: This operation should not be executed in a production environment.



Creating database schema...

Database schema created successfully!

PHP Fatal error:  Trait 'Tests\FixturesTrait' not found in /app/src/AppBundle/DataFixtures/ORM/PostFixtures.php on line 38



�[37;41m                                                                   �[39;49m

�[37;41m  [Symfony\Component\Debug\Exception\ClassNotFoundException]       �[39;49m

�[37;41m  Attempted to load trait "FixturesTrait" from namespace "Tests".  �[39;49m

�[37;41m  Did you forget a "use" statement for another namespace?          �[39;49m

�[37;41m                                                                   �[39;49m



�[32mdoctrine:fixtures:load [--fixtures [FIXTURES]] [--append] [--em EM] [--shard SHARD] [--purge-with-truncate] [--multiple-transactions] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] �[39m�[32m<command>�[39m
@apetitpa
Copy link

apetitpa commented Mar 15, 2017

I think this issue is related to the PR #490 and the fact that the namespace where FixturesTrait lives (Tests) is autoloaded in dev environment only. A fix might be to move this class from the tests folder to another folder under the AppBundle namespace maybe the dataFixtures folder ?

javiereguiluz added a commit that referenced this issue Mar 15, 2017
…ace (apetitpa, javiereguiluz)

This PR was merged into the master branch.

Discussion
----------

#504 Move FixturesTrait class from Tests to AppBundle namespace

Moved the FixturesTrait class to the AppBundle namespace in attempt to fix the heroku deployment failure. This class is needed not only in dev or test environments but also in production because the database is loaded using the doctrine fixtures bundle. Related to #504

Commits
-------

88fb877 Merge branch 'master' into fix-#504-heroku
7d2ce92 #504 Move FixturesTrait class from Tests to AppBundle namespace
@javiereguiluz
Copy link
Member

@fiunchinho thanks for reporting this error. It was fixed in #509.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants