Open ryan-williams opened 8 years ago
got the same issue, cannot figure out why.
I am deploying go app from fabric
and it is something like:
def deploy():
local('gvm use go1.6')
# do something to deploy
However it is not able to use specific version go. Please help to resolve this issue.
Try this out, I just added it to my config with the same issues and seems to be working now.
FILE: ~/.gvm/scripts/gvm-default
. "$GVM_ROOT/scripts/env/use"
Running into the same thing here when I try to setup gvm from a bash script.
I peeked a little more. The issue is in the code that checks to see if subcommands are valid:
if [ -f "$GVM_ROOT/scripts/$command" ];
(looking for scripts/use which doesn't exist, the script does exist at $GVM_ROOT/scripts/env/use)
what is the difference between these two directories?
Same issue here. When trying to run bash shell scripts via the vagrant non-privileged user (vagrant user). @bodepd did you ever resolve the issue?
I have same issue. When i use the 'gvm use' or 'gvm pkgset use' in bash script, the error is occur
Are you guys installed 'zsh' version but using in 'bash' or instead?
Same error on my machine, a fresh macOS 10.12 Sierra install. Using bash 4.4 from Homebrew, and the provided gvm bash curl install command.
I think direnv is getting in the way, see direnv/direnv#128.
I'm also struggling with the same problem when trying to use gvm use
in the shell script. Workaround which works for me is to source it in the script itself.
[[ -s "$GVM_ROOT/scripts/gvm" ]] && source "$GVM_ROOT/scripts/gvm"
Using Ubuntu 14.04 and default terminal.
on executing gvm use go1.4
on terminal, it works.
But fails with the above error, if the command is used in a makefile or shell script.
+1
I've made a wonderful, wonderful Ansible automation role which doesn't seem to work, but executing from the shell works fine. Here's the output - but I really want a solution so I can publish this for the world (and me) to use.
fatal: [localhost]: FAILED! => {
"changed": true,
"cmd": "gvm use go1.7.4 --default",
"delta": "0:00:00.032705",
"end": "2016-12-20 07:37:11.950701",
"failed": true,
"invocation": {
"module_args": {
"_raw_params": "gvm use go1.7.4 --default",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"warn": true
},
"module_name": "command"
},
"rc": 1,
"start": "2016-12-20 07:37:11.917996",
"stderr": "ERROR: Unrecognized command line argument: 'use'",
"stdout": "",
"stdout_lines": [],
"warnings": []
}
same error here, raspberian works from terminal but not from shell or python code !
#!/bin/sh
mkdir $1
cd $1
gvm pkgset create --local
gvm pkgset use --local
#####
this is a base shell script. has the ERROR: Unrecognized command line argument: 'use' issue.
but the gvm pkgset use --local
command could run on ubuntu terminal
restart your terminal or
source ~/.gvm/scripts/gvm
This is still happening! Doesn't seem to work in a Makefile even after sourcing gvm.
restart your terminal or
source ~/.gvm/scripts/gvm
This fixed my Jenkins build, but having to do it manually looks weird.
Before that I also tried to use a local zsh by adding #!/usr/bin/zsh to my shell script, but I'm still getting the "Unrecognized command line argument: 'use'" message.
Encountering it on v1.0.22
A temporary fix would be to cp ~/.gvm/scripts/env/use ~/.gvm/scripts
and give it execution rights.
source ~/.gvm/scripts/gvm
it works for me
None of the suggestions above work for me. I am sourcing the gvm
script right after installing it via curl
and I am still getting the error. What worked for me was the following:
gvm use "$stable_version" --default >/dev/null || true
It is nasty but works in this context.
Migrated to ASDF. Works beautifully on assorted Unix environments. Supports a wide variety of programming languages and development tools.
After previously having successfully run
gvm use go1.6
: