使用gradlew时出错:/ usr / bin / env:bash:没有这样的文件或目录 [英] Error with gradlew: /usr/bin/env: bash: No such file or directory

查看:1123
本文介绍了使用gradlew时出错:/ usr / bin / env:bash:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Git将我的项目的 gradlew 文件从我的Windows机器提交到远程仓库之后,调用 gradlew Linux服务器因此消息失败:
$ b

After committing my project's gradlew file from my Windows machine to the remote repo using Git, invoking gradlew on my Linux server failed with this message:


发生了什么?

What happened?

推荐答案

问题的原因是Git在Windows上将 gradlew 的行结尾从Unix样式(LF)转换为Windows样式(CRLF)。

The problem's cause was that Git on Windows converted the line endings of gradlew from Unix style (LF) to Windows style (CRLF).

您可以使用 git config core.autocrlf false

设置<$ c的行结束符$ c> gradlew 回到Unix风格修复了这个问题。在Vim中,这是通过使用 set fileformat = unix 来完成的。

Setting the line endings of gradlew back to Unix style fixed the problem. In Vim this is done using set fileformat=unix.

这篇关于使用gradlew时出错:/ usr / bin / env:bash:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆