Comments (4)
I got a similar issue.
Can you please confirm the value of your $PATH
before and after installing gvm
?
echo $PATH
In my case, I have a PATH containing space that accidentally replaced by :
https://twitter.com/gofrendiasgard/status/1695596852127941055
from gvm.
same issues
/home/chris/.gvm/bin:/home/chris/.config/nvm/versions/node/v14.21.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/go/bin:/home/chris/go/bin
chris@chris-PC:~$ type cd
cd 是函数
cd ()
{
if __gvm_is_function __gvm_oldcd; then
__gvm_oldcd $*;
fi;
local dot_go_version dot_go_pkgset rslt;
local defaults_go_name defaults_go_pkgset;
local defaults_resolved=false;
local defaults_hash;
defaults_hash=();
if [[ "$GVM_ROOT" == "" ]]; then
display_error "GVM_ROOT not set. Please source \$GVM_ROOT/scripts/gvm";
return $?;
fi;
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "Resolving defaults...";
defaults_hash=($(__gvm_read_environment_file "${GVM_ROOT}/environments/default"));
if [[ $? -eq 0 ]]; then
defaults_resolved=true;
else
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "Can't find default environment. Falling back to system.";
defaults_hash=($(__gvm_read_environment_file "${GVM_ROOT}/environments/system"));
if [[ $? -eq 0 ]]; then
defaults_resolved=true;
else
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "Can't find system environment.";
fi;
fi;
if [[ "${defaults_resolved}" == false ]]; then
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "Resolving fallback go version and pkgset from all available.";
local fallback_go_version="$(__gvm_resolve_fallback_version)";
local fallback_go_pkgset="$(__gvm_resolve_fallback_pkgset "${fallback_go_version}")";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "=======================================";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "fallback_go_version => $fallback_go_version";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "fallback_go_pkgset => $fallback_go_pkgset";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "=======================================";
defaults_hash=($(setValueForKeyFakeAssocArray "gvm_go_name" "${fallback_go_version}" "${defaults_hash[*]}"));
defaults_hash=($(setValueForKeyFakeAssocArray "gvm_pkgset_name" "${fallback_go_pkgset}" "${defaults_hash[*]}"));
unset fallback_go_version;
unset fallback_go_pkgset;
defaults_resolved=true;
fi;
defaults_go_name="$(valueForKeyFakeAssocArray "gvm_go_name" "${defaults_hash[*]}")";
defaults_go_pkgset="$(valueForKeyFakeAssocArray "gvm_pkgset_name" "${defaults_hash[*]}")";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "defaults_go_name => $defaults_go_name";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "defaults_go_pkgset => $defaults_go_pkgset";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
if [[ "${GVM_DEBUG}" -eq 1 ]]; then
echo "Resolved default go: ${defaults_go_name:-[EMPTY]}";
echo "Resolved default pkgset: ${defaults_go_pkgset:-[EMPTY]}";
fi;
dot_go_version="$(__gvmp_find_closest_dot_go_version)";
rslt=$?;
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "---------------------------------------";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "dot_go_version => $dot_go_version";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "defaults_go_name => $defaults_go_name";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "---------------------------------------";
if [[ $rslt -eq 0 ]]; then
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "Found dot_go_version: ${dot_go_version}";
local use_goversion="$(__gvmp_read_dot_go_version "${dot_go_version}")";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "Switching to: ${use_goversion}";
gvm use "${use_goversion}" || return 1;
unset use_goversion;
else
if [[ -n "${defaults_go_name}" ]]; then
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "No .go-version found. Using system or default go.";
else
if [[ "${GVM_DEBUG}" -eq 1 ]]; then
echo "No fallback go version could be found.";
if [[ ! -d "$GVM_ROOT/archive/go" ]]; then
echo "$(locale_text_for_key "go_install_prompt")";
fi;
fi;
return 0;
fi;
fi;
dot_go_pkgset="$(__gvmp_find_closest_dot_go_pkgset)";
rslt=$?;
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "--------------------------------";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "dot_go_pkgset => $dot_go_pkgset";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "--------------------------------";
if [[ $rslt -eq 0 ]]; then
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "Found .go-pkgset: ${dot_go_pkgset}";
local use_gopkgset="$(__gvmp_read_dot_go_pkgset "${dot_go_pkgset}")";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "Switching to: ${use_gopkgset}";
gvm pkgset use "${use_gopkgset}" || return 1;
unset use_gopkgset;
else
if [[ -n "${defaults_go_pkgset}" ]]; then
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "No .go-pkgset found. Using system or default pkgset.";
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "---------- defaults_go_pkgset => $defaults_go_pkgset ----------";
else
[[ "${GVM_DEBUG}" -eq 1 ]] && echo "No fallback pkgset could be found.";
fi;
fi;
return 0
}
from gvm.
how to fix it?
from gvm.
@clanaid @codingcn @sheepcat : Kindly try out this one. this supports bash
and zsh
both shells : https://github.com/ankitcharolia/goenv
from gvm.
Related Issues (20)
- iTerm error after installed gvm HOT 1
- pin version for a particular project HOT 3
- Unreasonable initial dependence
- ubuntu 23.10 after source gvm env ,the cd command cannot work HOT 1
- Why GVM always install `darwin/arm64`
- Overriden cd fails to switch to paths with spaces HOT 7
- panic: invalid path: 'css/bootstrap.min.css'
- Cannot install Go 1.4 HOT 3
- Significant ZSH Performance Slowdown After Adding gvm to PATH
- Startup error when having `cd` already set as alias
- Failed install go1.22 HOT 2
- Path incorrectly modified by GVM script HOT 6
- how to instal specific tmp folder on mac ?
- Message 'sed: first RE may not be empty' when using gvm switch version
- ERROR: Looks like the .git directory is present. Please reinstall GVM. HOT 1
- gvm use command causes GVM_ROOT to change
- gvm cd fails with Unrecognized command line argument: ''
- several gvm commands failing HOT 1
- `cd` command is slow HOT 2
- gvm requires go to compile go
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gvm.