Heroku CLI 未安装在 heroku git:clone 之后创建的子目录中
Heroku CLI not installed in sub-directory created after heroku git:clone
我正在尝试在新机器上创建一个开发环境,但在连接到 heroku 时卡住了。我下载并安装了 cli,heroku -v 显示我有最新版本。我的文件夹结构是 Users/tombrown/projects。当我在projects下手动新建一个目录时,新建的子目录也安装了cli,但是当我git clone或者heroku git:clone时,新建的子目录却提示没有安装cli。
Thomass-MacBook:projects tombrown$ heroku -v
heroku/7.16.0 darwin-x64 node-v10.10.0
Thomass-MacBook:projects tombrown$ heroku git:clone -a livebytransit
Cloning into 'livebytransit'...
remote: Counting objects: 4814, done.
remote: Compressing objects: 100% (1579/1579), done.
remote: Total 4814 (delta 3276), reused 4564 (delta 3087)
Receiving objects: 100% (4814/4814), 15.68 MiB | 5.75 MiB/s, done.
Resolving deltas: 100% (3276/3276), done.
Thomass-MacBook:projects tombrown$ cd livebytransit
Thomass-MacBook:livebytransit tombrown$ heroku -v
Install the Heroku CLI from https://cli.heroku.com
Thomass-MacBook:livebytransit tombrown$ rm -rf livebytransit
Thomass-MacBook:livebytransit tombrown$ cd ..
Thomass-MacBook:projects tombrown$ ls
livebytransit
Thomass-MacBook:projects tombrown$ rm -rf livebytransit
Thomass-MacBook:projects tombrown$ ls
Thomass-MacBook:projects tombrown$ git clone https://github.com/tom-brown/LiveByTransit.git
Cloning into 'LiveByTransit'...
remote: Counting objects: 4820, done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 4820 (delta 38), reused 50 (delta 23), pack-reused 4737
Receiving objects: 100% (4820/4820), 15.35 MiB | 6.14 MiB/s, done.
Resolving deltas: 100% (3285/3285), done.
Thomass-MacBook:projects tombrown$ cd LiveByTransit
Thomass-MacBook:LiveByTransit tombrown$ git init
Reinitialized existing Git repository in /Users/tombrown/projects/LiveByTransit/.git/
Thomass-MacBook:LiveByTransit tombrown$ git add .
Thomass-MacBook:LiveByTransit tombrown$ git commit -m "kind of first commit"
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
Thomass-MacBook:LiveByTransit tombrown$ heroku git:remote -a livebytransit
Install the Heroku CLI from https://cli.heroku.com
有人 运行 解决过这个问题吗?我在 heroku 帮助或 Whosebug 中没有看到类似的内容。
根据下面第一条评论中的建议,which heroku
和 type heroku
的输出都提供了一个很大的提示。路径有问题。
Thomass-MacBook:LiveByTransit tombrown$ which heroku
/Users/tombrown/.rvm/gems/ruby-2.3.1/bin/heroku
Thomass-MacBook:LiveByTransit tombrown$ type heroku
heroku is /Users/tombrown/.rvm/gems/ruby-2.3.1/bin/heroku
Thomass-MacBook:LiveByTransit tombrown$ cd ..
Thomass-MacBook:projects tombrown$ which heroku
/usr/local/bin/heroku
Thomass-MacBook:projects tombrown$ type heroku
heroku is /usr/local/bin/heroku
Thomass-MacBook:projects tombrown$
看起来你有 legacy heroku
Gem installed in your Ruby 2.3.1 RVM gemset. When that Ruby environment is active this will shadow the system-installed, modern heroku
CLI.
在您的 ~/.rvm/gems/ruby-2.3.1
环境处于活动状态的情况下,通过 运行 gem uninstall heroku
删除遗留 Gem。
我正在尝试在新机器上创建一个开发环境,但在连接到 heroku 时卡住了。我下载并安装了 cli,heroku -v 显示我有最新版本。我的文件夹结构是 Users/tombrown/projects。当我在projects下手动新建一个目录时,新建的子目录也安装了cli,但是当我git clone或者heroku git:clone时,新建的子目录却提示没有安装cli。
Thomass-MacBook:projects tombrown$ heroku -v
heroku/7.16.0 darwin-x64 node-v10.10.0
Thomass-MacBook:projects tombrown$ heroku git:clone -a livebytransit
Cloning into 'livebytransit'...
remote: Counting objects: 4814, done.
remote: Compressing objects: 100% (1579/1579), done.
remote: Total 4814 (delta 3276), reused 4564 (delta 3087)
Receiving objects: 100% (4814/4814), 15.68 MiB | 5.75 MiB/s, done.
Resolving deltas: 100% (3276/3276), done.
Thomass-MacBook:projects tombrown$ cd livebytransit
Thomass-MacBook:livebytransit tombrown$ heroku -v
Install the Heroku CLI from https://cli.heroku.com
Thomass-MacBook:livebytransit tombrown$ rm -rf livebytransit
Thomass-MacBook:livebytransit tombrown$ cd ..
Thomass-MacBook:projects tombrown$ ls
livebytransit
Thomass-MacBook:projects tombrown$ rm -rf livebytransit
Thomass-MacBook:projects tombrown$ ls
Thomass-MacBook:projects tombrown$ git clone https://github.com/tom-brown/LiveByTransit.git
Cloning into 'LiveByTransit'...
remote: Counting objects: 4820, done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 4820 (delta 38), reused 50 (delta 23), pack-reused 4737
Receiving objects: 100% (4820/4820), 15.35 MiB | 6.14 MiB/s, done.
Resolving deltas: 100% (3285/3285), done.
Thomass-MacBook:projects tombrown$ cd LiveByTransit
Thomass-MacBook:LiveByTransit tombrown$ git init
Reinitialized existing Git repository in /Users/tombrown/projects/LiveByTransit/.git/
Thomass-MacBook:LiveByTransit tombrown$ git add .
Thomass-MacBook:LiveByTransit tombrown$ git commit -m "kind of first commit"
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
Thomass-MacBook:LiveByTransit tombrown$ heroku git:remote -a livebytransit
Install the Heroku CLI from https://cli.heroku.com
有人 运行 解决过这个问题吗?我在 heroku 帮助或 Whosebug 中没有看到类似的内容。
根据下面第一条评论中的建议,which heroku
和 type heroku
的输出都提供了一个很大的提示。路径有问题。
Thomass-MacBook:LiveByTransit tombrown$ which heroku
/Users/tombrown/.rvm/gems/ruby-2.3.1/bin/heroku
Thomass-MacBook:LiveByTransit tombrown$ type heroku
heroku is /Users/tombrown/.rvm/gems/ruby-2.3.1/bin/heroku
Thomass-MacBook:LiveByTransit tombrown$ cd ..
Thomass-MacBook:projects tombrown$ which heroku
/usr/local/bin/heroku
Thomass-MacBook:projects tombrown$ type heroku
heroku is /usr/local/bin/heroku
Thomass-MacBook:projects tombrown$
看起来你有 legacy heroku
Gem installed in your Ruby 2.3.1 RVM gemset. When that Ruby environment is active this will shadow the system-installed, modern heroku
CLI.
在您的 ~/.rvm/gems/ruby-2.3.1
环境处于活动状态的情况下,通过 运行 gem uninstall heroku
删除遗留 Gem。