Skip to content
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

openai migration on Windows WSL error. instructions are wrong #1880

Open
AMDphreak opened this issue Nov 20, 2024 · 1 comment
Open

openai migration on Windows WSL error. instructions are wrong #1880

AMDphreak opened this issue Nov 20, 2024 · 1 comment

Comments

@AMDphreak
Copy link

AMDphreak commented Nov 20, 2024

The migration guide section for Windows using WSL does not function properly. After running 'curl -fsSL https://docs.grit.io/install | bash' within the source code directory, the new bash instance does not have 'grit' included in the path variable. I am using an Ubuntu WSL image.

UPDATE
Did some more diagnosing, turns out the pipe command does literally nothing for the user. Why are you piping the output of a curl statement without accessing the piped output in your bash command after the pipe? You made the terminal print the file into the void. The curl command literally produces the text from the file, not a file. You need to pipe this crap into a file, then run that file in the new bash instance.

curl -fsSL https://docs.grit.io/install > grit_install_script.sh | bash
./grit_install_script.sh

In addition, you need to include the install location in the user path variable, because this is what happens if you don't:

downloading grit 0.1.0-alpha.1731963650 x86_64-unknown-linux-gnu
installing to /home/ryan/.grit/bin
  grit
everything's installed!
ryan@IAmDevloper:/mnt/r/Google Drive/Code/Repositories/offline/openAI desktop user helper$ grit install
Command 'grit' not found, did you mean:

So add this command after the execution:
export PATH=$PATH:$HOME/.grit/bin to append the install location
after this, you do not need to do grit install it is redundant at this point. The problem with your script is you needed grit installed in order to run the grit install command, which makes a cyclic dependency.

Original post excerpt:

Automatic migration with grit on Windows

To use grit to migrate your code on Windows, you will need to use Windows Subsystem for Linux (WSL). Installing WSL is quick and easy, and you do not need to keep using Linux once the command is done.

Here's a step-by-step guide for setting up and using WSL for this purpose:

  1. Open a PowerShell or Command Prompt as an administrator and run wsl --install.
  2. Restart your computer.
  3. Open the WSL application.
  4. In the WSL terminal, cd into the appropriate directory (e.g., cd /mnt/c/Users/Myself/my/code/) and then run the following commands:
    curl -fsSL https://docs.grit.io/install | bash
    grit install
    grit apply openai

Then, you can close WSL and go back to using Windows.

Originally posted by @rattrayalex in #742

@AMDphreak AMDphreak changed the title We have released a new major version of our SDK, and we recommend upgrading promptly. openai migration on Windows WSL error. instructions are wrong Nov 20, 2024
@AMDphreak
Copy link
Author

AMDphreak commented Nov 20, 2024

Looking inside the script file, it is apparent that the script should already set the path variable. I guess I just forgot to refresh the shell after running the downloaded script. Doesn't change the cyclic dependency though

    # * early-bound: export PATH="/home/myuser/.myapp:$PATH"
    # * late-bound:  export PATH="$HOME/.myapp:$PATH"
        export PATH="$_install_dir_expr:\$PATH"

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

No branches or pull requests

1 participant