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

bash: diesel: command not found #1131

Closed
yyolf117 opened this Issue Aug 26, 2017 · 11 comments

Comments

Projects
None yet
2 participants
@yyolf117

yyolf117 commented Aug 26, 2017

I've installed "diesel_cli" but when I'm calling "diesel setup" or "diesel_cli", the exception is "bash: diesel: command not found" or "bash: diesel_cli: command not found". What's the matter? Wasn't it supposed to insert itself into the path?

@killercup

This comment has been minimized.

Member

killercup commented Aug 26, 2017

@yyolf117

This comment has been minimized.

yyolf117 commented Aug 26, 2017

yes, with cargo install.

@yyolf117

This comment has been minimized.

yyolf117 commented Aug 26, 2017

$ ls ~/.cargo/bin/
diesel

but

$ diesel
bash: diesel: command not found

and one more thing:

what if I gave it a different name? MY_DATABASE_URL

`
$ diesel setup

[.................................]

The --database-url argument must be passed, or the DATABASE_URL environment variable must be set.`

@killercup

This comment has been minimized.

Member

killercup commented Aug 26, 2017

So, I guess ~/.cargo/bin/ isn't in $PATH? It probably should be! ;)

You can also tell cargo install to install it somewhere else, like /usr/local/bin.

(I think rustup adds this but only for certain shells and system.)

@yyolf117

This comment has been minimized.

yyolf117 commented Aug 26, 2017

ok, how about my last question?

@killercup

This comment has been minimized.

Member

killercup commented Aug 26, 2017

I didn't see your edit or the question in the code block.

what if I gave it a different name? MY_DATABASE_URL

Then… you have an environment variable called MY_DATABASE_URL. But diesel_cli has no way of knowing that it exists or that it should even care about that. Thus, you'll need to pass it the --database-url argument with the (you guessed it) database url, or use the env variable name it expects.

@yyolf117

This comment has been minimized.

yyolf117 commented Aug 26, 2017

thx. but I can't use the env. variable called DATABASE_URL in each project I have because, of course, each connection string in each proejct is different.

@killercup

This comment has been minimized.

Member

killercup commented Aug 26, 2017

That's what the .env file is for :) Have a look at the guide.

@yyolf117 yyolf117 closed this Aug 26, 2017

@yyolf117

This comment has been minimized.

yyolf117 commented Aug 27, 2017

I didn't find anything related to "--database-url" being passed as an argument to diesel in the command line in the guides, where is it?

@killercup

This comment has been minimized.

Member

killercup commented Aug 27, 2017

@yyolf117

This comment has been minimized.

yyolf117 commented Aug 27, 2017

yeah, thanks.

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