初めてインストールした際に、以下のエラーが発生しました。
discourse-setup: line 260: *0: syntax error: operand expected (error token is "*0")
Hostname for your Discourse? [discourse.example.com]:
何が間違っていたのか、何か提案はありますか?
初めてインストールした際に、以下のエラーが発生しました。
discourse-setup: line 260: *0: syntax error: operand expected (error token is "*0")
Hostname for your Discourse? [discourse.example.com]:
何が間違っていたのか、何か提案はありますか?
こんにちは、おかえりなさい!
Discourseのインストールを試みているOSを詳しく教えていただけますか?
こんにちは!これはUbuntu 20.04.6 LTSです。
Linux ubuntu 5.4.0-1082-raspi aarch64 aarch64 aarch64 GNU/Linux
git pull から始めることをお勧めします。それでもスクリプトがこのようになる場合は、代わりに bash -vx ./discourse-setup を試してみてください。そうすれば何が起こっているか確認できるかもしれません。(260行目がこの問題を引き起こすとは思いません)
260行目の行:
avail_cores=$((`awk '/cpu cores/ {print $4;exit}' /proc/cpuinfo`*`sort /proc/cpuinfo | uniq | grep -c "physical id"`))
bash -x の出力:
scale_ram_and_cpu
+ scale_ram_and_cpu
+ local changelog=/tmp/changelog.11937
+ avail_gb=0
+ avail_cores=0
++ check_OS
+++ uname -s
++ echo Linux
+ os_type=Linux
+ '[' Linux == Darwin ']'
++ check_linux_memory
+++ free -m --si
+++ awk ' /Mem:/ {print $2}'
++ mem=3975
++ '[' 3975 -ge 990 -a 3975 -lt 1000 ']'
+++ free -g --si
+++ awk ' /Mem:/ {print $2} '
++ echo 3
+ avail_gb=3
++ awk '/cpu cores/ {print $4;exit}' /proc/cpuinfo
++ sort /proc/cpuinfo
++ uniq
++ grep -c 'physical id'
./discourse-setup: line 260: *0: syntax error: operand expected (error token is "*0")
cat /proc/cpuinfo:
root@ubuntu:/var/discourse# cat /proc/cpuinfo
processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
Hardware : BCM2835
Revision : c03112
Serial : 10000000d0894f90
Model : Raspberry Pi 4 Model B Rev 1.2
ここにはいくつかの方法があると思います。おそらく私はこれを選びます。
avail_cores=$((`lscpu --parse=core | awk 'NF==1' | sort -u | wc -l`))
(論理コア、CPU、ソケット、またはプロセッサではなく、現在オンラインの物理コアの総数を計算しようとしています)
あなたのケースでも機能しますか?
はい、4が返ってきます。
したがって、/proc/cpuinfo を解析するよりも lscpu を使用する方が良いかもしれません。
素晴らしい - PR を提出しました
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.