vscode-rufo icon indicating copy to clipboard operation
vscode-rufo copied to clipboard

Command not found

Open tadao opened this issue 6 years ago • 21 comments

Hi there, I installed rufo gem and vscode-rufo. But I can't use the rufo extension because of not found error. How can I solve this?

2018-05-30 13 03 58

tadao avatar May 30 '18 04:05 tadao

hmm, sounds like you did everything right. are you running multiple ruby versions on your machine? i always make sure to gem install from the same working dir as VS Code is using (which varies depending on what folder you opened)

On Wed, 30 May 2018 at 05:07 Tadamasa [email protected] wrote:

Hi there, I installed rufo gem and vscode-rufo. But I can't use the rufo extension because of not found error. How can I solve this?

[image: 2018-05-30 13 03 58] https://user-images.githubusercontent.com/5387858/40698516-54fb4bca-640a-11e8-8751-0bd62b04dcba.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bessey/vscode-rufo/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AArOaM7qLouAGoIVHZb9f6dJe1T6ODoSks5t3hr1gaJpZM4USkVh .

bessey avatar Jun 20 '18 16:06 bessey

Same issue here -- can confirm that rufo is installed by just being able to run rufo file.rb in the terminal. But upon save, I get the same warning as OP.

shahzeb1 avatar Feb 14 '19 20:02 shahzeb1

Can you confirm that the directory that rufo is being run from is in your $PATH? E.g.

» which rufo /Users/matt/.rbenv/shims/rufo

» echo $PATH /Users/matt/Downloads/google-cloud-sdk/bin /Users/matt/.rbenv/shims ...

Matt

On Thu, 14 Feb 2019 at 20:25, Shahzeb K. [email protected] wrote:

Same issue here -- Can confirm that rufo is installed by just being able to run rufo file.rb in the terminal. But upon save, I get the same warning as OP.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bessey/vscode-rufo/issues/9#issuecomment-463781067, or mute the thread https://github.com/notifications/unsubscribe-auth/AArOaNWZ87WImiKNgWIgIHZh_F3TpqNeks5vNcZKgaJpZM4USkVh .

bessey avatar Feb 15 '19 11:02 bessey

which rufo:

/Users/shahzeb/.rvm/gems/ruby-2.4.2/bin/rufo

echo $PATH:

/Users/shahzeb/anaconda3/bin:/Users/shahzeb/.rvm/gems/ruby-2.4.2/bin:/Users/shahzeb/.rvm/gems/ruby-2.4.2@global/bin:/Users/shahzeb/.rvm/rubies/ruby-2.4.2/bin:/Users/shahzeb/.rvm/bin:/Users/shahzeb/.nvm/versions/node/v7.8.0/bin:/usr/local/opt/qt/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/usr/local/heroku/bin:/Users/shahzeb/Library/Python/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Applications/MAMP/bin/php/php5.6.2/bin/php:/Users/shahzeb/.node/bin:/Applications/MAMP/bin/php/php5.6.2/bin/php:/usr/local/Cellar/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/opt/X11/bin:/usr/local/git/bin:/Users/shahzeb/anaconda3/bin:/usr/local/opt/qt/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/usr/local/heroku/bin:/Users/shahzeb/Library/Python/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Applications/MAMP/bin/php/php5.6.2/bin/php:/Users/shahzeb/.node/bin:/usr/local/Cellar/bin:/Users/shahzeb/.npm-packages/bin:/Users/shahzeb/Dev/go/bin:/Users/shahzeb/.composer/vendor/bin:/Users/shahzeb/Downloads/android-sdk-macosx/tools:/Users/shahzeb/Downloads/android-sdk-macosx/platform-tools:/Users/shahzeb/.npm-packages/bin:/Users/shahzeb/Dev/go/bin:/Users/shahzeb/.composer/vendor/bin:/Users/shahzeb/Downloads/android-sdk-macosx/tools:/Users/shahzeb/Downloads/android-sdk-macosx/platform-tools:/Users/shahzeb/Downloads/android-sdk-macosx/platform-tools:/Users/shahzeb/Downloads/android-sdk-macosx/tools:/Users/shahzeb/.rvm/bin

I know my path is a mess haha. But the .rvm/bin destination for rufo is in the path.

shahzeb1 avatar Feb 16 '19 19:02 shahzeb1

I do not use RVM so I cannot help debug it. All I know is the plugin works fine for myself and my team, but we are an rbenv shop.

I recommend rbenv or chruby!

bessey avatar Feb 17 '19 21:02 bessey

Is there anyway to specify in vscode where to look for Rufo? I am having the same issue and my path is similar to @shahzeb1

There's definitely a solution for this we just need to find it :)

karltaylor avatar Jun 20 '19 11:06 karltaylor

There is not right now. I have never run into these VS Code PATH issues so I don't know how to debug them I'm afraid :( Matt

On Thu, 20 Jun 2019 at 12:05, Karl [email protected] wrote:

Is there anyway to specify in vscode where to look for Rufo? I am having the same issue and my path is similar to @shahzeb1 https://github.com/shahzeb1

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bessey/vscode-rufo/issues/9?email_source=notifications&email_token=AAFM42HN74D3A3CX23XBRR3P3NP7PA5CNFSM4FCKIVQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYFCXEI#issuecomment-503982993, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFM42BLRIRW7PBFP7E23PTP3NP7PANCNFSM4FCKIVQQ .

bessey avatar Jun 20 '19 11:06 bessey

I have the same issue using this in VSCode with remote development plugin.

/bin/sh: rufo: command not found

which rufo

/opt/rh/rh-ruby25/root/usr/local/bin/rufo

JMDC-SUN avatar Jul 25 '19 02:07 JMDC-SUN

Interesting that it's sh and not bash. Could be Vs code is using a different shell to your system and therefore the path is different?

On Thu, 25 Jul 2019, 03:19 JMDC-SUN, [email protected] wrote:

I have the same issue using this in VSCode with remote development plugin.

/bin/sh: rufo: command not found

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bessey/vscode-rufo/issues/9?email_source=notifications&email_token=AAFM42HFYCZVVTIC5OROZ2LQBEETDA5CNFSM4FCKIVQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2YEHYI#issuecomment-514868193, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFM42HQBT5RNOYCRNT3DEDQBEETDANCNFSM4FCKIVQQ .

bessey avatar Aug 08 '19 23:08 bessey

I was getting the same error when attempting to use rufo in VS Code with rvm and found a solution:

Make sure to launch VSCode from a shell session where ruff is in your $PATH i.e. cd into your project directory (not using VS Code) and then launch VS Code from there, code .

cineron avatar Aug 28 '19 02:08 cineron

For what it's worth, I've had a lot of issues with rufo but they were because of Prettier. I must have done something to mess it up but uninstalling and reinstalling Prettier allowed rufo to work.

sunny-mittal avatar Nov 27 '19 03:11 sunny-mittal

I was getting the same error when attempting to use rufo in VS Code with rvm and found a solution:

Make sure to launch VSCode from a shell session where ruff is in your $PATH i.e. cd into your project directory (not using VS Code) and then launch VS Code from there, code .

Could explain this?. I do not understand "...and then launch VS Code from there..."

mandres avatar Apr 22 '20 16:04 mandres

With VS Code closed, in your Terminal Window (not in the VS Code built in Terminal), make sure that you are in the directory (folder) that contains your project (for example: "cd ~/path/to/your/coolProject/"). While in that directory, run the Terminal command that opens VS Code (for example, $coolProject> "code .")

cineron avatar Apr 22 '20 22:04 cineron

With VS Code closed, in your Terminal Window (not in the VS Code built in Terminal), make sure that you are in the directory (folder) that contains your project (for example: "cd ~/path/to/your/coolProject/"). While in that directory, run the Terminal command that opens VS Code (for example, $coolProject> "code .")

You are a genius!. Thanks a lot!

mandres avatar Apr 23 '20 12:04 mandres

No wonder I've never been able to reproduce this error, that's how I always open Vs code!

If anyone knows a way to avoid having to do this, please let me know or open a PR

On Thu, 23 Apr 2020, 13:06 Miguel Andrés, [email protected] wrote:

With VS Code closed, in your Terminal Window (not in the VS Code built in Terminal), make sure that you are in the directory (folder) that contains your project (for example: "cd ~/path/to/your/coolProject/"). While in that directory, run the Terminal command that opens VS Code (for example, $coolProject> "code .")

You are a genius!. Thanks a lot!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bessey/vscode-rufo/issues/9#issuecomment-618363596, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFM42FEUCQNBDRRFMKBEBLROAVKZANCNFSM4FCKIVQQ .

bessey avatar Apr 24 '20 18:04 bessey

With VS Code closed, in your Terminal Window (not in the VS Code built in Terminal), make sure that you are in the directory (folder) that contains your project (for example: "cd ~/path/to/your/coolProject/"). While in that directory, run the Terminal command that opens VS Code (for example, $coolProject> "code .")

You are a genius!. Thanks a lot!

1st step: Open Terminal Window (not the VS code built-in terminal) 2nd step: I change directory to my project directory 3rd step: I run sudo gem install rufo 4th step: I run code . to open my project directory

Outcome: When I launch vscode from the application (not from the terminal, I am able to use the rufo formatter). same goes for launching the vscode from the terminal

Hopefully, it helps :)

lukasleeyo avatar Apr 29 '20 13:04 lukasleeyo

for anyone still with this issue and not wanting to open projects from their terminal: In most cases vscode is installed in the your-computer/disk/Applications but the project will be in your-computer/disk/Users/you/some-path when I did which rufo in my applications folder it gave no result, so I did gem install rufo (had to sudo it) in the applications folder, restarted vscode and don't get the error anymore.

riencoertjens avatar Jan 12 '21 09:01 riencoertjens

@cineron i was banging my head making my ruby setup work, your comment is a lifesaver. Thank you so much

debaghtk avatar May 09 '21 16:05 debaghtk

For what it's worth, the shell command to open vscode via the terminal is not installed by default. You need to install it. Instructions here: https://code.visualstudio.com/docs/setup/mac.

colemerrick avatar Aug 25 '21 00:08 colemerrick

With VS Code closed, in your Terminal Window (not in the VS Code built in Terminal), make sure that you are in the directory (folder) that contains your project (for example: "cd ~/path/to/your/coolProject/"). While in that directory, run the Terminal command that opens VS Code (for example, $coolProject> "code .")

Nice!

flleo avatar Jun 12 '23 23:06 flleo

for anyone still with this issue and not wanting to open projects from their terminal: In most cases vscode is installed in the your-computer/disk/Applications but the project will be in your-computer/disk/Users/you/some-path when I did which rufo in my applications folder it gave no result, so I did gem install rufo (had to sudo it) in the applications folder, restarted vscode and don't get the error anymore.

@riencoertjens two years later, this comment saved me - thank you!!

yochannah avatar Sep 05 '23 13:09 yochannah