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

Please run `composer install` to install dependencies #65

Closed
asbjornu opened this Issue Nov 9, 2017 · 7 comments

Comments

Projects
None yet
3 participants
@asbjornu
Member

asbjornu commented Nov 9, 2017

After going through the required steps to get there4/markdown-resume and all of its dependencies (leafo/scssphp, symfony/event-dispatcher) installed with composer, I now have the ./vendor/bin/md2resume binary available. But executing it only yields the following:

Please run composer install to install dependencies

However, executingcomposer install doesn't actually install anything because everything seems to be installed:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

Ideas on what I might be missing or doing wrong?

@asbjornu

This comment has been minimized.

Member

asbjornu commented Nov 13, 2017

I've dug around and found that the error message Please run composer install to install dependencies comes from bin/md2resume because it can't find the file /vendor/autoload.php.

I've checked and the file is there, but since I'm running markdown-resume from where it is installed with Composer (./vendor/bin/md2resume), the relative path to autoload.php is different. I'll see if I can figure out how to fix this in a PR.

@asbjornu asbjornu referenced this issue Nov 13, 2017

Merged

Path fixes #66

@nkanderson

This comment has been minimized.

nkanderson commented Nov 27, 2017

I've just run into this issue, getting the message The dependency '' was not found. Please run `composer install` to install dependencies. when trying to run the example command from the readme quickstart section, ./bin/md2resume html examples/source/sample.md examples/output/.

I installed via git clone, with the default directory name of "markdown-resume". As a result, the logic in PR #66 checking basename($baseDir) against the string markdown-resume returns true, and assigns a non-existent file (or rather, realpath returns false) for $autoloadPath.

I'd be happy to create a new PR, but could use a recommendation on how to ensure a proper autoload file location. If the current logic is good, but not specific enough, would it make sense to use dirname to check if md2resume is being run from within a vendor directory?

@nkanderson

This comment has been minimized.

nkanderson commented Nov 30, 2017

@asbjornu should I open a new ticket for this issue, with the use case of installing via git clone? Or does it make sense to re-open this one?

@asbjornu

This comment has been minimized.

Member

asbjornu commented Nov 30, 2017

@nkanderson: Good question. What I would love was if we were able to concoct some tests for these scenarios so we don't break one use-case every time we fix another, whack-a-mole style. Perhaps @craig-davis has ideas for how we can add some automated tests for this?

@ddulic

This comment has been minimized.

ddulic commented Jan 19, 2018

Same problem when trying to run from a docker container.
Anyone have any tips?

FROM php:7-cli
VOLUME /examples
ENV DEBIAN_FRONTEND noninteractive
RUN docker-php-ext-install mbstring
RUN apt-get update && apt-get -qqy install wget wkhtmltopdf git unzip xvfb
RUN wget https://github.com/there4/markdown-resume/archive/master.zip && unzip master.zip && mv markdown-resume-master markdown-resume
RUN cd markdown-resume && curl --silent --show-error https://getcomposer.org/installer | php \
    && ./composer.phar update && chmod +x ./bin/md2resume && ls -alh ./vendor/bin
CMD cd markdown-resume && xvfb-run ./bin/md2resume pdf --template readable /examples/source/ddulic.md /examples/output/
~/Projects/markdown-resume-master
❯ docker run --rm -t -i -e DISPLAY -v $PWD/examples:/examples:rw ddulic/resume

#46

@nkanderson

This comment has been minimized.

nkanderson commented Jan 19, 2018

@ddulic As a quick fix, I changed the $autoloadPath in bin/md2resume to the following:
$autoloadPath = $baseDir . '/vendor/autoload.php

There's a line with a ternary that assigns to $autoloadPath conditionally based on the name of the base directory, but in my case of installing via git clone, it does so incorrectly.

@ddulic

This comment has been minimized.

ddulic commented Jan 19, 2018

Thanks @nkanderson for the fix.
Did a fork and implemented it for my own needs.
It seems this problem also occurred even if I downloaded the zip but renamed the folder.

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