- macOS Catalina bad interpreter: No such file or directory #15460
- Comments
- duanhjlt commented Oct 9, 2019 •
- fastlane-bot commented Oct 9, 2019
- jcharr1 commented Oct 9, 2019
- T-Jedsada commented Oct 9, 2019 •
- alindaj6 commented Oct 9, 2019
- jcharr1 commented Oct 9, 2019 •
- jcharr1 commented Oct 9, 2019 •
- /bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory #28217
- Comments
- ASaputra2019 commented Mar 3, 2020
- Steps To Reproduce
- Expected Results
- Copyright (c) Facebook, Inc. and its affiliates.
- This source code is licensed under the MIT license found in the
- LICENSE file in the root directory of this source tree.
- Remove automake symlink if it exists
- Fix build for tvOS
- Prepare exported header include
- JohnpeterDairianadan commented Mar 3, 2020
- JohnpeterDairianadan commented Mar 3, 2020
- ASaputra2019 commented Mar 3, 2020
- JohnpeterDairianadan commented Mar 3, 2020
- OkancanCosar commented Mar 4, 2020 •
- JohnpeterDairianadan commented Mar 4, 2020 •
- OkancanCosar commented Mar 4, 2020
- JohnpeterDairianadan commented Mar 4, 2020
- alexyoubaifu commented Mar 6, 2020
- EmperorEarth commented Mar 6, 2020 •
- Не удалось выполнить файл .sh: / bin / bash ^ M: плохой интерпретатор
- High Sierra: bad interpreter #6898
- Comments
- Juice805 commented Jul 25, 2017
- Report
- What did you do?
- What did you expect to happen?
- What happened instead?
- CocoaPods Environment
- Juice805 commented Jul 25, 2017 •
- justvanbloom commented Sep 26, 2017 •
- raisezhang commented Sep 29, 2017 •
- anton-ogarkov commented Oct 3, 2017 •
- chuongtrh commented Oct 9, 2017
- chanduiosdeveloper commented Nov 10, 2017
- shaunbaker04 commented Nov 16, 2017
- wangdetong commented Nov 16, 2017
- donpauldev commented Nov 17, 2017
- shaunbaker04 commented Nov 17, 2017
- jiaokang commented Nov 22, 2017
- zirinisp commented Nov 22, 2017
- surya687 commented Dec 13, 2017
- abhiveeru85 commented Jan 9, 2018 •
- justvanbloom commented Jan 9, 2018
macOS Catalina bad interpreter: No such file or directory #15460
Comments
duanhjlt commented Oct 9, 2019 •
I installed Catalina, but i got error when i run fastlane.
The text was updated successfully, but these errors were encountered:
fastlane-bot commented Oct 9, 2019
It seems like you have not included the output of fastlane env
To make it easier for us help you resolve this issue, please update the issue to include the output of fastlane env 👍
jcharr1 commented Oct 9, 2019
I had this issue after upgrading to Catalina with several gems. What I had to do is uninstall all my user gems, delete the contents of my user gems directory, and then reinstall the gems. The key was that it wasn’t enough to just uninstall them through gem. I had to manually delete the directory contents too.
T-Jedsada commented Oct 9, 2019 •
alindaj6 commented Oct 9, 2019
@jcharr1 can you tell me what are you doing in detail to make the fastlane working again?
i am really stuck now
jcharr1 commented Oct 9, 2019 •
@alindaj6 how did you install fastlane? Directly with gem or with brew ?
Basically, what you need to do is go into the folder where your gems are installed (GEM_HOME), delete the contents of that folder, and then reinstall fastlane and any other gems you need. That should point the gems to the correct version of Ruby that was updated in Catalina.
jcharr1 commented Oct 9, 2019 •
For example, I have my GEM_HOME setup to be in my user folder (
/.gem) so I can install gems without using sudo . So in my case, what I did was:
- run gem uninstall -aIx . This should uninstall all your installed gems and their binaries. Though this doesn’t seem to completely get rid of them and it didn’t fix the error for me after reinstalling.
- So next I went into my gem install directory and deleted the contents of it. For me this is
Источник
/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory #28217
Comments
ASaputra2019 commented Mar 3, 2020
As suggested by the docs, I uninstalled global react-native-cli, and use npx instead.
I encounter this error when running :
npx react-native init AwesomeProject
as the error suggests, I run
cd ./AwesomeProject/ios && pod install
But still get the same error during installation of glog as follow:
/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
React Native version:
bash: react-native: command not found
Steps To Reproduce
- brew install node
- brew install watchman
- sudo gem install cocoapods -n /usr/local/bin
- npx react-native init AwesomeProject
Expected Results
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
if [ -z «$CURRENT_ARCH» ] || [ «$CURRENT_ARCH» == «undefined_arch» ]; then
# Xcode 10 beta sets CURRENT_ARCH to «undefined_arch», this leads to incorrect linker arg.
# it’s better to rely on platform name as fallback because architecture differs between simulator and device
export CC=»$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME —show-sdk-path)»
export CXX=»$CC»
Remove automake symlink if it exists
if [ -h «test-driver» ]; then
rm test-driver
fi
./configure —host arm-apple-darwin
Fix build for tvOS
/* Add in so we have Apple Target Conditionals */
#ifdef APPLE
#include
#include
#endif
/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif
/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(x86_64)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(i386)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF
Prepare exported header include
EXPORTED_INCLUDE_DIR=»exported/glog»
mkdir -p exported/glog
cp -f src/glog/log_severity.h «$EXPORTED_INCLUDE_DIR/»
cp -f src/glog/logging.h «$EXPORTED_INCLUDE_DIR/»
cp -f src/glog/raw_logging.h «$EXPORTED_INCLUDE_DIR/»
cp -f src/glog/stl_logging.h «$EXPORTED_INCLUDE_DIR/»
cp -f src/glog/vlog_is_on.h «$EXPORTED_INCLUDE_DIR/»
/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
The text was updated successfully, but these errors were encountered:
JohnpeterDairianadan commented Mar 3, 2020
Same issue, I have been trying to fix this since yesterday with various ways to convert the character, used dos2unix, vim fileformat=unix and a lot, nothing works. Am using MacOS with pod install (already remove entire Pods directory), so no possibility of getting the file accidentally opened or edited on windows.
JohnpeterDairianadan commented Mar 3, 2020
@ASaputra2019 open the file node_modules/react-native/scripts/ios-configure-glog.sh in Sublime Text editor, change the line endings with View > Line Endings > Mac OS 9, save and try pod install, it works. Note: It doesn’t works when you change to Unix line endings so must to Mac OS 9 in sublime text or some equivalent mac line ending from other tools.
ASaputra2019 commented Mar 3, 2020
@JohnpeterDairianadan Thank you so much, it solved my problem that has been on my mind since yesterday too. Similar to you, I tried with dos2unix, also with vi and vim, but to no avail.. Crashed my environment trying to change anything in the process. But finally with Sublime Text it works! Thank you!!
JohnpeterDairianadan commented Mar 3, 2020
good to hear, but I would prefer to keep the issue open, as we remove node_modules sometime and wont exist in switching environment, so it is still an open issue, I just tried a workaround.
OkancanCosar commented Mar 4, 2020 •
actually View > Line Endings > Mac OS 9, save and try pod install, it works. but after that run react-native run-ios command return
config.h dosn’t found in mutex.h. this issue opened on 2018
#19774
I don’t understand, now no one ios dev. dosn’t use react-native on ios
My setup new, maybe it was my fauld
System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Memory: 207.86 MB / 8.00 GB
Shell: 5.7.1 — /bin/zsh
Binaries:
Node: 13.8.0 — /usr/local/bin/node
Yarn: 1.22.0 — /usr/local/bin/yarn
npm: 6.13.7 — /usr/local/bin/npm
Watchman: 4.9.0 — /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Xcode: 11.3.1/11C504 — /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
JohnpeterDairianadan commented Mar 4, 2020 •
@OkancanCosar I got this issue solved yesterday with manually installed the third party libs glog, folly etc with the scripts under react-native node_module dir, and building the glog with cmake configure and make, then copied that to pod’s glog dir, then it works. #22703 (comment).. But instead of the change in script made in the linked comment, I did
# SCRIPTDIR=$(dirname «$0»)
SCRIPTDIR=$(pwd)/$(dirname «$0»)
fetch_and_unpack glog-0.3.5.tar.gz https://github.com/google/glog/archive/v0.3.5.tar.gz 61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc «sh \»$SCRIPTDIR/ios-configure-glog.sh\»»
OkancanCosar commented Mar 4, 2020
sorry for my dummy 🙁
react-native init myproj
err => /bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory
node_modules/react-native/scripts/ios-configure-glog.sh => View > Line Endings > Mac OS 9, save and run pod install
i expect there is folder named node_modules/react-native/third_party but not.
react-native run-ios
err => myproj/ios/Pods/glog/src/base/mutex.h:105:10: fatal error: ‘config.h’ file not found
SCRIPTDIR=$(pwd)/$(dirname «$0»)
fetch_and_unpack glog-0.3.5.tar.gz https://github.com/google/glog/archive/v0.3.5.tar.gz 61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc «sh «$SCRIPTDIR/ios-configure-glog.sh»»
cd node_modules/react-native/ && scripts/ios-install-third-party.sh
and now created node_modules/react-native/third_party folder.
and then run-ios
still myproj/ios/Pods/glog/src/base/mutex.h:105:10: fatal error: ‘config.h’ file not found
JohnpeterDairianadan commented Mar 4, 2020
after the third_party folder gets created and the glog, folly etc are fetched, go inside the glog directory (or may be to sub dir in the glog where configure file exist), then ./configure, then ./make, those missing config.h and other files will get created now, then copy all the files created under src, replace with pods glog dir then similary do for folly, but for folly you dont need to ./configure or ./make. just replace the files in pod folly. then run-ios it should build
alexyoubaifu commented Mar 6, 2020
I got the same problem, but I found #22703(comment) solved my issue instead of going to run the ios-configure-glog.sh or copy folders around. Hope this helpful.
EmperorEarth commented Mar 6, 2020 •
hat tip to elpardo farther down in this thread
- check your git’s global autocrlf setting
- git config —global core.autocrlf
- repository one doesn’t matter for this issue (my repo setting was right but my global one was wrong)
- if it isn’t already, set it to input on macOS ( false also works, see documentation link below)
- git config —global —add core.autocrlf input
Hacky workaround spoilered to avoid misleading used these instructions a couple of days ago after reading a few dozen comments across several threads for convenience, most lines can be triple clicked to copy/paste assumed you are comfortable editing in `vi`, if not, you’ll need to adjust as necessary
Источник
Не удалось выполнить файл .sh: / bin / bash ^ M: плохой интерпретатор
Я хотел выполнить скрипт оболочки:
Я пытался сделать стандартную процедуру, но я получил эту ошибку:
Что это значит? Я делал это как root пользователь в root группе.
Означает ли это, что файл не имеет правильного разрешения для root пользователя?
Это не проблема с разрешением, вы не получаете сообщение о разрешениях
Скрипт указывает, что он должен выполняться оболочкой, расположенной в /bin/bash^M . Нет такого файла: он называется /bin/bash .
^M Является символом возврата каретки . Linux использует символ перевода строки, чтобы отметить конец строки, тогда как Windows использует двухсимвольную последовательность CR LF. Ваш файл имеет окончания строки Windows, что сбивает с толку Linux.
Удалить поддельные символы CR. Вы можете сделать это с помощью следующей команды:
В vim вы также можете использовать :set ff=unix и затем сохранить файл, или :set ff=dos снова получить форматирование DOS.
Ваш файл имеет окончания строки в стиле DOS / Windows (CR LF) , но в Unix-подобных системах в качестве разрыва строки используется только управляющий символ LF .
Дополнительный символ управления CR отображается в кодировке, как ^M на вашем выходе. Вы также можете увидеть это, когда вы бежите cat -A create_mgw_3shelf_6xIPNI1P.sh .
Чтобы преобразовать окончания строк из стиля DOS / Windows в стиль Unix, есть инструмент под названием dos2unix . Вы устанавливаете это используя:
Затем вы можете просто конвертировать окончания строк в файлах обоими способами, используя
В вашем случае просто выполните следующую команду ниже, и файл сценария будет преобразован на месте:
После этого Bash должен правильно интерпретировать файл.
Проблема в том, что вы редактируете с помощью Dos!
откройте ваш файл с помощью vi, затем установите unix с помощью:
и все нормально
тогда :set list ; он отобразит любой из специальных символов в вашем скрипте.
затем замените символ:
:%s/^M//gc [набрать ^M нажмите Ctrl + v + m ]
Как объяснено в других ответах, это проблема формата. Итак, ответ — изменить формат с DOS на окончания строк в стиле Unix. Это еще один простой способ исправить ваш файл «на месте»
Это доступно в упаковке tofrodos :
Вы также можете использовать Gedit для удаления нежелательных символов. В меню File выберите Save As и установите тип конца строки unix / Linux.
Источник
High Sierra: bad interpreter #6898
Comments
Juice805 commented Jul 25, 2017
Report
What did you do?
What did you expect to happen?
What happened instead?
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
CocoaPods Environment
Similar to this report I am unable to use the pod command. However, unlike his report reinstalling does not fix the issue.
The text was updated successfully, but these errors were encountered:
Juice805 commented Jul 25, 2017 •
Seemed to have fixed it. Some combination of rbenv, and sudo xcode-select —switch /Applications/Xcode-beta.app . It seems it was searching /Users/justin/Applications/Xcode.app originally and finding no CL Dev tools
justvanbloom commented Sep 26, 2017 •
gem install -n /usr/local/bin cocoapods
raisezhang commented Sep 29, 2017 •
anton-ogarkov commented Oct 3, 2017 •
Actually if you are using Fastlane and have this issue with it, you can use the approach from @raisezhang . Just use fastlane instead of cocoapods in the last command.
chuongtrh commented Oct 9, 2017
Actually if you are using Fastlane and have this issue with it, you can use the approach from @raisezhang . Just use fastlane instead of cocoapods in the last command.
chanduiosdeveloper commented Nov 10, 2017
After upgrading to macOS High Sierra, get it fixed with following commands:
sudo gem install cocoapods
shaunbaker04 commented Nov 16, 2017
Just installed High Sierra and had the above listed problem and used: sudo gem install cocoapods
Worked perfectly and I’m back in business. Thanks guys 🙂
wangdetong commented Nov 16, 2017
(this help me)Try reinstalling:gem install cocoapods
donpauldev commented Nov 17, 2017
sudo gem install -n /usr/local/bin cocoapods
shaunbaker04 commented Nov 17, 2017
It’s closed. Solved.
jiaokang commented Nov 22, 2017
When I run gem update —system under root. I get a error :
Updating rubygems-update
Fetching: rubygems-update-2.7.2.gem (100%)
Successfully installed rubygems-update-2.7.2
Parsing documentation for rubygems-update-2.7.2
Installing ri documentation for rubygems-update-2.7.2
Installing darkfish documentation for rubygems-update-2.7.2
Done installing documentation for rubygems-update after 46 seconds
Parsing documentation for rubygems-update-2.7.2
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 2.7.2
ERROR: While executing gem . (Errno::EPERM)
Operation not permitted @ rb_sysopen — /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem
zirinisp commented Nov 22, 2017
I got this issue with both cocoapods and fastlane. Using @raisezhang solution fixed both
surya687 commented Dec 13, 2017
I too have the same problem as mentioned in the above post When I run gem update —system under root.
abhiveeru85 commented Jan 9, 2018 •
I am having the same issue as mentioned by @jiaokang, gem update —system giving error under root.
justvanbloom commented Jan 9, 2018
Not as root. Exec as normal user.
See my first comment or here
gem install -n /usr/local/bin cocoapods
OS X does not allow in system due to system integrate protection. Shure you can turn it off but thats a bad idea. And /usr/local/bin is correct for now.
Источник