WSL2 – 永夜 https://www.shuijingwanwq.com 没有不值得去解决的问题,也没有不值得去学习的技术! Sat, 16 May 2026 10:59:24 +0000 zh-Hans hourly 1 https://wordpress.org/?v=7.0 使用 Docker + VS Code Dev Container 搭建 Python 音乐闹钟开发环境(WSL 实战记录) https://www.shuijingwanwq.com/2026/04/22/9567/ https://www.shuijingwanwq.com/2026/04/22/9567/#respond Wed, 22 Apr 2026 07:30:53 +0000 https://www.shuijingwanwq.com/?p=9567 浏览量: 167

一、背景:为什么要做这个环境

为了学习 AI 编程工具(如通义灵码),我准备实现一个“音乐闹钟”小项目。
在开始编码之前,我先搭建一套可复用的 Python Dev Container 开发环境。

二、技术栈说明

  • Windows 10
  • WSL2 (Ubuntu)
  • Docker
  • VS Code
  • Python 3.10 (Alpine)
  • Dev Container

三、项目目录结构(核心重点)

music-alarm/
├── .devcontainer/
│ └── devcontainer.json
├── docker-compose.yml
├── main.py
├── requirements.txt
├── .gitignore
└── README.md

✔ 解释每个文件作用
📁 .devcontainer/devcontainer.json
VS Code Dev Container 配置文件
用于定义:

  • 使用哪个 Docker 服务
  • 工作目录
  • 插件
  • 自动安装依赖
    📁 docker-compose.yml
    定义 Python 运行环境容器
  • Python 镜像
  • 代码挂载
  • 工作目录 /app
  • 保持容器运行
    📁 main.py
    音乐闹钟核心逻辑入口
    后续会在这里实现:
  • 定时任务
  • 播放音乐
    📁 requirements.txt(预留)
    未来 AI / 音乐闹钟依赖管理文件
    例如:
    schedule
    playsound
    📁 .gitignore
    用于忽略:
  • Python 缓存
  • IDE 文件
  • 环境变量

四、Dev Container 配置说明(重点).devcontainer/devcontainer.json

{
  "name": "Python Music Alarm Dev Container",

  "dockerComposeFile": ["../docker-compose.yml"],
  "service": "python",
  "workspaceFolder": "/app",

  "shutdownAction": "stopCompose",

  "customizations": {
    "vscode": {
      "extensions": [
        "ms-python.python",
        "ms-python.vscode-pylance",
        "ms-azuretools.vscode-docker",
        "eamodio.gitlens"
      ],
      "settings": {
        "terminal.integrated.defaultProfile.linux": "sh",
        "python.defaultInterpreterPath": "/usr/local/bin/python"
      }
    }
  },

  "remoteUser": "root",

  "postCreateCommand": "apk update && apk add git && pip install --upgrade pip"
}

五、docker-compose.yml 说明(重点)

该文件用于启动 Python 开发容器,并挂载本地代码:
volumes:

  • ./:/app

👉 核心意义:

保证代码在宿主机(WSL)保存,不会随容器销毁而丢失

services:
  python:
    image: python:3.10-alpine
    container_name: python-music-alarm

    working_dir: /app

    volumes:
      - ./:/app

    tty: true
    stdin_open: true

    command: tail -f /dev/null

    # ✔ 关键:保证 Git / VS Code 兼容
    environment:
      - PYTHONDONTWRITEBYTECODE=1
      - PYTHONUNBUFFERED=1

六、VS Code 使用方式(操作步骤)

Step 1:打开项目
code .
Step 2:进入 Dev Container
Ctrl + Shift + P
→ Dev Containers: Reopen in Container
Step 3:确认环境
python –version
git –version
Step 4:打开 Git UI
Ctrl + Shift + G
Step 5:文件 – 将工作区另存为 C:\Users\Thinkpad\VSCodeWorkspaces\python-music-alarm-app.code-workspace,便于后期直接从文件打开工作区

七、验证环境是否成功,在 GitHub 上的目录结构如图1

验证环境是否成功,在 GitHub 上的目录结构


✔ Python 可运行
✔ Git 可用
✔ VS Code 进入 Dev Container
✔ 代码可持久化(不会丢)

八、本篇总结
通过 Docker + Dev Container,我完成了一套标准化 Python 开发环境。
这为后续使用通义灵码实现“音乐闹钟”项目打下了基础。

]]>
https://www.shuijingwanwq.com/2026/04/22/9567/feed/ 0
Windows 10 下 Redis 的安装(基于 WSL2 安装) https://www.shuijingwanwq.com/2024/08/06/8753/ https://www.shuijingwanwq.com/2024/08/06/8753/#respond Tue, 06 Aug 2024 01:47:31 +0000 https://www.shuijingwanwq.com/?p=8753 浏览量: 400 1、Redis 官方没有 Windows 下的原生安装包。如图1
Redis 官方没有 Windows 下的原生安装包

图1

2、参考:该项目不再积极维护。如果您正在寻找 Windows 版本的 Redis,您可能需要查看 Memurai。请注意,Microsoft 不以任何方式正式认可该产品。决定使用 Memurai。如图2
参考:https://github.com/MSOpenTech/redis ,该项目不再积极维护。如果您正在寻找 Windows 版本的 Redis,您可能需要查看 Memurai。请注意,Microsoft 不以任何方式正式认可该产品。决定使用 Memurai。

图2

3、安装 Memurai-Developer-v4.1.2.msi 完毕后,重启电脑,以使环境变量生效。 4、最后发现没有效果,C:\Program Files\Memurai 不存在。执行:C:\>msiexec /quiet /i Memurai.msi 后,仍然没有效果。最终决定放弃。


PS C:\> msiexec /quiet /i Memurai.msi
PS C:\>


5、查看端口 6379 又是被占用了的。


PS C:\> netstat -ano | findstr :6379
  TCP    192.168.89.29:63792    3.231.104.211:443      ESTABLISHED     4920


6、参考:安装或启用 WSL2 。如图3
安装或启用 WSL2

图3



PS C:\> wsl --install
正在安装: 虚拟机平台
已安装 虚拟机平台。
正在安装: 适用于 Linux 的 Windows 子系统
已安装 适用于 Linux 的 Windows 子系统。
正在安装: 适用于 Linux 的 Windows 子系统
已安装 适用于 Linux 的 Windows 子系统。
正在安装: Ubuntu
已安装 Ubuntu。
请求的操作成功。直到重新启动系统前更改将不会生效。
PS C:\>


7、安装 Redis,进入 Ubuntu,从官方 APT 存储库安装 Redis 的最新稳定版本packages.redis.io。将存储库添加到apt索引,更新它,然后安装。如图4
安装 Redis,进入 Ubuntu,从官方 APT 存储库安装 Redis 的最新稳定版本packages.redis.io。将存储库添加到apt索引,更新它,然后安装

图4



root@DESKTOP-H4MGQIU:~# curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
root@DESKTOP-H4MGQIU:~# echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb jammy main
root@DESKTOP-H4MGQIU:~# sudo apt-get update
Get:1 https://packages.redis.io/deb jammy InRelease [3821 B]
Get:2 https://packages.redis.io/deb jammy/main all Packages [4502 B]
Get:3 https://packages.redis.io/deb jammy/main amd64 Packages [21.2 kB]
Hit:4 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:5 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1673 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [14.1 MB]
Get:10 http://security.ubuntu.com/ubuntu jammy-security/main Translation-en [279 kB]
Get:11 http://security.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [13.0 kB]
Get:12 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2171 kB]
Get:13 http://security.ubuntu.com/ubuntu jammy-security/restricted Translation-en [372 kB]
Get:14 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 c-n-f Metadata [572 B]
Get:15 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [886 kB]
Get:16 http://security.ubuntu.com/ubuntu jammy-security/universe Translation-en [173 kB]
Get:17 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [18.9 kB]
Get:18 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [37.2 kB]
Get:19 http://security.ubuntu.com/ubuntu jammy-security/multiverse Translation-en [7588 B]
Get:20 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 c-n-f Metadata [228 B]
Get:21 http://archive.ubuntu.com/ubuntu jammy/universe Translation-en [5652 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy/universe amd64 c-n-f Metadata [286 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [217 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy/multiverse Translation-en [112 kB]
Get:25 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 c-n-f Metadata [8372 B]
Get:26 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1888 kB]
Get:27 http://archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [337 kB]
Get:28 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [17.7 kB]
Get:29 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [2238 kB]
Get:30 http://archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [384 kB]
Get:31 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 c-n-f Metadata [604 B]
Get:32 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1108 kB]
Get:33 http://archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [258 kB]
Get:34 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [25.4 kB]
Get:35 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [43.3 kB]
Get:36 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse Translation-en [10.8 kB]
Get:37 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 c-n-f Metadata [444 B]
Get:38 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [67.1 kB]
Get:39 http://archive.ubuntu.com/ubuntu jammy-backports/main Translation-en [11.0 kB]
Get:40 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]
Get:41 http://archive.ubuntu.com/ubuntu jammy-backports/restricted amd64 c-n-f Metadata [116 B]
Get:42 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [28.8 kB]
Get:43 http://archive.ubuntu.com/ubuntu jammy-backports/universe Translation-en [16.5 kB]
Get:44 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [672 B]
Get:45 http://archive.ubuntu.com/ubuntu jammy-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 32.8 MB in 19s (1686 kB/s)
Reading package lists... Done
root@DESKTOP-H4MGQIU:~# sudo apt-get install redis
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  redis-server redis-tools
Suggested packages:
  ruby-redis
The following NEW packages will be installed:
  redis redis-server redis-tools
0 upgraded, 3 newly installed, 0 to remove and 112 not upgraded.
Need to get 1726 kB of archives.
After this operation, 9790 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://packages.redis.io/deb jammy/main amd64 redis-tools amd64 6:7.2.5-1rl1~jammy1 [1610 kB]
Get:2 https://packages.redis.io/deb jammy/main amd64 redis-server amd64 6:7.2.5-1rl1~jammy1 [82.3 kB]
Get:3 https://packages.redis.io/deb jammy/main amd64 redis all 6:7.2.5-1rl1~jammy1 [33.9 kB]
Fetched 1726 kB in 4s (493 kB/s)
Selecting previously unselected package redis-tools.
(Reading database ... 24208 files and directories currently installed.)
Preparing to unpack .../redis-tools_6%3a7.2.5-1rl1~jammy1_amd64.deb ...
Unpacking redis-tools (6:7.2.5-1rl1~jammy1) ...
Selecting previously unselected package redis-server.
Preparing to unpack .../redis-server_6%3a7.2.5-1rl1~jammy1_amd64.deb ...
Unpacking redis-server (6:7.2.5-1rl1~jammy1) ...
Selecting previously unselected package redis.
Preparing to unpack .../redis_6%3a7.2.5-1rl1~jammy1_all.deb ...
Unpacking redis (6:7.2.5-1rl1~jammy1) ...
Setting up redis-tools (6:7.2.5-1rl1~jammy1) ...
Setting up redis-server (6:7.2.5-1rl1~jammy1) ...
Setting up redis (6:7.2.5-1rl1~jammy1) ...
Processing triggers for man-db (2.10.2-1) ...
root@DESKTOP-H4MGQIU:~#



8、编辑 Redis的配置文件 /etc/redis/redis.conf。到绑定选项(bind),通常默认是绑定到127.0.0.1,修改为绑定到所有接口 0.0.0.0。如图5
编辑 Redis的配置文件 /etc/redis/redis.conf。到绑定选项(bind),通常默认是绑定到127.0.0.1,修改为绑定到所有接口 0.0.0.0

图5

9、保存并关闭文件。然后重新启动Redis服务以使更改生效:


sudo service redis-server restart


10、在WSL终端中运行 ip addr来查找WSL的IP地址


root@DESKTOP-H4MGQIU:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:7b:2d:f2 brd ff:ff:ff:ff:ff:ff
    inet 172.24.155.141/20 brd 172.24.159.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe7b:2df2/64 scope link
       valid_lft forever preferred_lft forever
root@DESKTOP-H4MGQIU:~#


11、为默认用户设置身份验证密码,不然可能无法从外部 Windows 主机访问 Redis。然后重启服务。如图6
为默认用户设置身份验证密码,不然可能无法从外部 Windows 主机访问 Redis。然后重启服务

图6



root@DESKTOP-H4MGQIU:~# vi /etc/redis/redis.conf
root@DESKTOP-H4MGQIU:~# sudo service redis-server restart
root@DESKTOP-H4MGQIU:~#


12、在Windows上连接到WSL中的Redis,连接成功。如图7
在Windows上连接到WSL中的Redis,连接成功

图7

]]>
https://www.shuijingwanwq.com/2024/08/06/8753/feed/ 0
在 WSL2 中的 Ubuntu-20.04 ,将 Shopify CLI 更新至最新版本 https://www.shuijingwanwq.com/2023/12/25/8300/ https://www.shuijingwanwq.com/2023/12/25/8300/#respond Mon, 25 Dec 2023 02:42:05 +0000 https://www.shuijingwanwq.com/?p=8300 浏览量: 70

1、执行 shopify version,以查看 Shopify CLI 的当前版本

wangqiang@DESKTOP-QLPK8QM:~$ shopify version
Current Shopify CLI version: 3.49.7
💡 Version 3.52.0 available!

2、执行 shopify upgrade,以将 Shopify CLI 更新至最新版本,报错:Error: EACCES: permission denied, rename ‘/usr/lib/node_modules/@shopify/cli’ -> ‘/usr/lib/node_modules/@shopify/.cli-9RdBklQd’ 。如图1

执行 shopify upgrade,以将 Shopify CLI 更新至最新版本,报错:Error: EACCES: permission denied, rename '/usr/lib/node_modules/@shopify/cli' -> '/usr/lib/node_modules/@shopify/.cli-9RdBklQd'

图1

wangqiang@DESKTOP-QLPK8QM:~$ shopify upgrade
Upgrading CLI from 3.49.7 to 3.52.0...
Attempting to upgrade via npm install -g @shopify/cli@latest @shopify/theme@latest...
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/@shopify/cli
npm ERR! dest /usr/lib/node_modules/@shopify/.cli-9RdBklQd
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/lib/node_modules/@shopify/cli' -> '/usr/lib/node_modules/@shopify/.cli-9RdBklQd'
npm ERR!  [Error: EACCES: permission denied, rename '/usr/lib/node_modules/@shopify/cli' -> '/usr/lib/node_modules/@shopify/.cli-9RdBklQd'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'rename',
npm ERR!   path: '/usr/lib/node_modules/@shopify/cli',
npm ERR!   dest: '/usr/lib/node_modules/@shopify/.cli-9RdBklQd'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/wangqiang/.npm/_logs/2023-12-07T03_09_49_269Z-debug-0.log
Upgrade failed!
── external error ────────────────────────────────────────────────────────────────────────────────────────────────

Error coming from `npm install -g @shopify/cli@latest @shopify/theme@latest`

Command failed with exit code 243: npm install -g @shopify/cli@latest @shopify/theme@latest

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────

3、在命令 npm install -g @shopify/cli@latest @shopify/theme@latest 前添加 sudo,以提升权限,不再报错

wangqiang@DESKTOP-QLPK8QM:~$ sudo npm install -g @shopify/cli@latest @shopify/theme@latest

changed 1013 packages in 1m

121 packages are looking for funding
  run `npm fund` for details

4、但是查看版本号,仍然无变化。参考:https://www.shuijingwanwq.com/2023/11/29/8249/ 执行:shopify version 时,提示:Version 3.49.7 available!,但是执行:shopify upgrade 成功后,仍然提示:Version 3.49.7 available!。决定暂缓处理。

wangqiang@DESKTOP-QLPK8QM:~$ shopify version
Current Shopify CLI version: 3.49.7
💡 Version 3.52.0 available!
]]>
https://www.shuijingwanwq.com/2023/12/25/8300/feed/ 0
构建 Shopify App Template – PHP 时,ln -sf ../frontend/dist/assets public/assets,’ln’ is not recognized as an internal or external command,operable program or batch file. https://www.shuijingwanwq.com/2023/07/04/7799/ https://www.shuijingwanwq.com/2023/07/04/7799/#respond Tue, 04 Jul 2023 01:22:09 +0000 https://www.shuijingwanwq.com/?p=7799 浏览量: 115 1、在执行:npm run build 时,报错:ln -sf ../frontend/dist/assets public/assets,’ln’ is not recognized as an internal or external command,operable program or batch file. 。如图1
在执行:npm run build 时,报错:ln -sf ../frontend/dist/assets public/assets,'ln' is not recognized as an internal or external command,operable program or batch file.

图1



PS E:\wwwroot\shopify-app\learn-php-app-20230510> npm run build --api-key=a3ca28cb106a5280859a9a52994d3446

> learn-php-app-20230510@1.0.0 build
> shopify app build


 frontend         │
 frontend         │ > build
 frontend         │ > vite build
 frontend         │
 backend          │ > composer build-frontend-links
 frontend         │
 frontend         │ Building the frontend app without an API key. The frontend build will not run without an API key. Set the
                    SHOPIFY_API_KEY environment variable when running the build command.
 frontend         │
 frontend         │ vite v2.9.15 building for production...
 frontend         │ transforming...
 backend          │ > ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html
 backend          │ 'ln' is not recognized as an internal or external command,
 backend          │ operable program or batch file.
 backend          │ Script ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html handling
                    the build-frontend-links event returned with error code 1
 backend          │ Script composer build-frontend-links handling the build event returned with error code 1

── external error ──────────────────────────────────────────────────────────────

Error coming from `composer build`

Command failed with exit code 1: composer build
> composer build-frontend-links
> ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html
'ln' is not recognized as an internal or external command,
operable program or batch file.
Script ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html handling the
 build-frontend-links event returned with error code 1
Script composer build-frontend-links handling the build event returned with error code 1

────────────────────────────────────────────────────────────────────────────────

Error: Failed to kill process 17484: Error: Command failed: taskkill /pid 17484 /T /F
ERROR: The process "17484" not found.

    at file:///E:/wwwroot/shopify-app/learn-php-app-20230510/node_modules/@shopify/cli-kit/dist/public/node/system.js:49:27
    at ChildProcess.exithandler (node:child_process:404:5)
    at ChildProcess.emit (node:events:390:28)
    at ChildProcess.emit (node:domain:475:12)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
PS E:\wwwroot\shopify-app\learn-php-app-20230510>


2、由于 Windows 系统不支持,最终决定在 WSL2 中的 Ubuntu-20.04 系统中执行此命令。提示:No such file or directory 。如图2
由于 Windows 系统不支持,最终决定在 WSL2 中的 Ubuntu-20.04 系统中执行此命令。提示:No such file or directory

图2

3、可参考:在 WSL2 中的 Ubuntu-20.04 中创建应用:Shopify App Template – PHP https://www.shuijingwanwq.com/2023/07/01/7792/ 4、再次运行构建命令,不再报错。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605$ npm run build --api-key=4611762cfca6d9d949cb806d776c7088

> learn-php-app-ubuntu-2004-0605@1.0.0 build
> shopify app build

 frontend         │
 frontend         │ > shopify-frontend-template-react@1.0.0 build
 frontend         │ > vite build
 frontend         │
 frontend         │
 frontend         │ > shopify-frontend-template-react@1.0.0 build
 frontend         │ > vite build
 frontend         │
 frontend         │
 frontend         │ Building the frontend app without an API key. The frontend build will not run without an API key. Set the
                    SHOPIFY_API_KEY environment variable when running the build command.
 frontend         │
 frontend         │
 frontend         │ Building the frontend app without an API key. The frontend build will not run without an API key. Set the
                    SHOPIFY_API_KEY environment variable when running the build command.
 frontend         │
 frontend         │ vite v4.3.9 building for production...
 frontend         │ vite v4.3.9 building for production...
 frontend         │ transforming...
 frontend         │ transforming...
 backend          │ > composer build-frontend-links
 backend          │ > ln -sf ../frontend/dist/assets public/assets && ln -sf ../frontend/dist/index.html public/index.html
 frontend         │ ✓ 1877 modules transformed.
 frontend         │ ✓ 1877 modules transformed.
 frontend         │ rendering chunks...
 frontend         │ rendering chunks...
 frontend         │ computing gzip size...
 frontend         │ computing gzip size...
 frontend         │ dist/assets/empty-state-8039a1e1.svg      0.26 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/empty-state-8039a1e1.svg      0.26 kB │ gzip:   0.20 kB
 frontend         │ dist/index.html                           0.48 kB │ gzip:   0.33 kB
 frontend         │ dist/assets/home-trophy-d70b3542.png     20.65 kB
 frontend         │ dist/assets/index-37530742.css          371.48 kB │ gzip:  45.42 kB
 frontend         │ dist/assets/ja-abb1af27.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/ko-ef9a93f5.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/th-32f01d1c.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/zh-4775ba45.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/vi-72f55a87.js                0.23 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/nb-79727cd5.js                0.24 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/tr-d5c962f0.js                0.24 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/de-5d4a5256.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/fi-e67a7779.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/nl-ed6c02b1.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/da-9b835bb8.js                0.31 kB │ gzip:   0.22 kB
 frontend         │ dist/assets/cs-d855408e.js                0.32 kB │ gzip:   0.23 kB
 frontend         │ dist/assets/sv-8ac62b51.js                0.37 kB │ gzip:   0.25 kB
 frontend         │ dist/assets/en-d265ad8d.js                0.41 kB │ gzip:   0.26 kB
 frontend         │ dist/assets/es-fd2f35f4.js                0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pt-227fd344.js                0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pt-PT-a0c51464.js             0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pl-ab15c7ea.js                0.42 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/fr-23e50d95.js                0.43 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/it-08f76780.js                0.45 kB │ gzip:   0.30 kB
 frontend         │ dist/assets/en-df34a502.js                1.53 kB │ gzip:   0.77 kB
 frontend         │ dist/assets/de-2ae5c9fa.js                1.72 kB │ gzip:   0.90 kB
 frontend         │ dist/assets/fr-5253333d.js                1.83 kB │ gzip:   0.94 kB
 frontend         │ dist/assets/polyfill-force-b2df9935.js    5.21 kB │ gzip:   2.02 kB
 frontend         │ dist/assets/zh-CN-cf74d136.js             7.72 kB │ gzip:   3.26 kB
 frontend         │ dist/assets/zh-TW-6a74a185.js             7.86 kB │ gzip:   3.36 kB
 frontend         │ dist/assets/ko-2cf626e6.js                8.18 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/ja-6f78282b.js                8.35 kB │ gzip:   3.58 kB
 frontend         │ dist/assets/en-c240dff3.js                9.95 kB │ gzip:   2.95 kB
 frontend         │ dist/assets/vi-e4ef4fd6.js                9.97 kB │ gzip:   3.34 kB
 frontend         │ dist/assets/th-2a34d5e0.js               10.14 kB │ gzip:   3.77 kB
 frontend         │ dist/assets/sv-a901b08f.js               10.22 kB │ gzip:   3.27 kB
 frontend         │ dist/assets/da-1564850b.js               10.30 kB │ gzip:   3.26 kB
 frontend         │ dist/assets/nb-0a6d8490.js               10.35 kB │ gzip:   3.25 kB
 frontend         │ dist/assets/pl-a603e9c2.js               10.39 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/cs-3c753a97.js               10.40 kB │ gzip:   3.50 kB
 frontend         │ dist/assets/fi-c0a9d95f.js               10.63 kB │ gzip:   3.41 kB
 frontend         │ dist/assets/tr-bd45be97.js               10.68 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/it-8bb02787.js               10.72 kB │ gzip:   3.32 kB
 frontend         │ dist/assets/pt-PT-af188c06.js            10.85 kB │ gzip:   3.34 kB
 frontend         │ dist/assets/nl-0772ea77.js               10.89 kB │ gzip:   3.25 kB
 frontend         │ dist/assets/pt-BR-8a1d5660.js            10.94 kB │ gzip:   3.36 kB
 frontend         │ dist/assets/es-5e0e20e7.js               10.95 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/de-a04fe3bd.js               11.11 kB │ gzip:   3.35 kB
 frontend         │ dist/assets/fr-1848494a.js               11.31 kB │ gzip:   3.48 kB
 frontend         │ dist/assets/index-92a00347.js            38.36 kB │ gzip:  15.16 kB
 frontend         │ dist/assets/polyfill-6fab3648.js        133.64 kB │ gzip:  40.74 kB
 frontend         │ dist/assets/index-e36d32ea.js           614.98 kB │ gzip: 163.80 kB
 frontend         │ ✓ built in 43.09s
 frontend         │
 frontend         │ (!) Some chunks are larger than 500 kBs after minification. Consider:
 frontend         │ - Using dynamic import() to code-split the application
 frontend         │ - Use build.rollupOptions.output.manualChunks to improve chunking:
                    https://rollupjs.org/configuration-options/#output-manualchunks
 frontend         │ - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
 frontend         │ dist/index.html                           0.48 kB │ gzip:   0.33 kB
 frontend         │ dist/assets/home-trophy-d70b3542.png     20.65 kB
 frontend         │ dist/assets/index-37530742.css          371.48 kB │ gzip:  45.42 kB
 frontend         │ dist/assets/ja-abb1af27.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/ko-ef9a93f5.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/th-32f01d1c.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/zh-4775ba45.js                0.21 kB │ gzip:   0.15 kB
 frontend         │ dist/assets/vi-72f55a87.js                0.23 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/nb-79727cd5.js                0.24 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/tr-d5c962f0.js                0.24 kB │ gzip:   0.17 kB
 frontend         │ dist/assets/nl-ed6c02b1.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/fi-e67a7779.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/de-5d4a5256.js                0.28 kB │ gzip:   0.20 kB
 frontend         │ dist/assets/da-9b835bb8.js                0.31 kB │ gzip:   0.22 kB
 frontend         │ dist/assets/cs-d855408e.js                0.32 kB │ gzip:   0.23 kB
 frontend         │ dist/assets/sv-8ac62b51.js                0.37 kB │ gzip:   0.25 kB
 frontend         │ dist/assets/en-d265ad8d.js                0.41 kB │ gzip:   0.26 kB
 frontend         │ dist/assets/es-fd2f35f4.js                0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pt-227fd344.js                0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pt-PT-a0c51464.js             0.41 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/pl-ab15c7ea.js                0.42 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/fr-23e50d95.js                0.43 kB │ gzip:   0.29 kB
 frontend         │ dist/assets/it-08f76780.js                0.45 kB │ gzip:   0.30 kB
 frontend         │ dist/assets/en-df34a502.js                1.53 kB │ gzip:   0.77 kB
 frontend         │ dist/assets/de-2ae5c9fa.js                1.72 kB │ gzip:   0.90 kB
 frontend         │ dist/assets/fr-5253333d.js                1.83 kB │ gzip:   0.94 kB
 frontend         │ dist/assets/polyfill-force-b2df9935.js    5.21 kB │ gzip:   2.02 kB
 frontend         │ dist/assets/zh-CN-cf74d136.js             7.72 kB │ gzip:   3.26 kB
 frontend         │ dist/assets/zh-TW-6a74a185.js             7.86 kB │ gzip:   3.36 kB
 frontend         │ dist/assets/ko-2cf626e6.js                8.18 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/ja-6f78282b.js                8.35 kB │ gzip:   3.58 kB
 frontend         │ dist/assets/en-c240dff3.js                9.95 kB │ gzip:   2.95 kB
 frontend         │ dist/assets/vi-e4ef4fd6.js                9.97 kB │ gzip:   3.34 kB
 frontend         │ dist/assets/th-2a34d5e0.js               10.14 kB │ gzip:   3.77 kB
 frontend         │ dist/assets/sv-a901b08f.js               10.22 kB │ gzip:   3.27 kB
 frontend         │ dist/assets/da-1564850b.js               10.30 kB │ gzip:   3.26 kB
 frontend         │ dist/assets/nb-0a6d8490.js               10.35 kB │ gzip:   3.25 kB
 frontend         │ dist/assets/pl-a603e9c2.js               10.39 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/cs-3c753a97.js               10.40 kB │ gzip:   3.50 kB
 frontend         │ dist/assets/fi-c0a9d95f.js               10.63 kB │ gzip:   3.41 kB
 frontend         │ dist/assets/tr-bd45be97.js               10.68 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/it-8bb02787.js               10.72 kB │ gzip:   3.32 kB
 frontend         │ dist/assets/pt-PT-af188c06.js            10.85 kB │ gzip:   3.34 kB
 frontend         │ dist/assets/nl-0772ea77.js               10.89 kB │ gzip:   3.25 kB
 frontend         │ dist/assets/pt-BR-8a1d5660.js            10.94 kB │ gzip:   3.36 kB
 frontend         │ dist/assets/es-5e0e20e7.js               10.95 kB │ gzip:   3.39 kB
 frontend         │ dist/assets/de-a04fe3bd.js               11.11 kB │ gzip:   3.35 kB
 frontend         │ dist/assets/fr-1848494a.js               11.31 kB │ gzip:   3.48 kB
 frontend         │ dist/assets/index-92a00347.js            38.36 kB │ gzip:  15.16 kB
 frontend         │ dist/assets/polyfill-6fab3648.js        133.64 kB │ gzip:  40.74 kB
 frontend         │ dist/assets/index-e36d32ea.js           614.98 kB │ gzip: 163.80 kB
 frontend         │ ✓ built in 43.05s
 frontend         │
 frontend         │ (!) Some chunks are larger than 500 kBs after minification. Consider:
 frontend         │ - Using dynamic import() to code-split the application
 frontend         │ - Use build.rollupOptions.output.manualChunks to improve chunking:
                    https://rollupjs.org/configuration-options/#output-manualchunks
 frontend         │ - Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.

╭─ success ────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  learn-php-app-ubuntu-2004-0605 built!                                       │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605$


]]>
https://www.shuijingwanwq.com/2023/07/04/7799/feed/ 0
在 WSL2 中的 Ubuntu-20.04 中创建应用:Shopify App Template – PHP https://www.shuijingwanwq.com/2023/07/01/7792/ https://www.shuijingwanwq.com/2023/07/01/7792/#comments Sat, 01 Jul 2023 02:06:44 +0000 https://www.shuijingwanwq.com/?p=7792 浏览量: 268

1、参考:在 WSL2 中的 Ubuntu-20.04 中安装 Shopify CLI 3.0(基于 Node.js),提前检查相应的要求是否满足

2、创建应用,选择 PHP 模板,报错:operation not permitted, copyfile

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ npm init @shopify/app@latest
Need to install the following packages:
  @shopify/create-app@3.46.2
Ok to proceed? (y)

Welcome. Let’s get started by naming your app project. You can change it later.

?  Your app project name?
✔  learn-php-app-ubuntu-2004-0602

?  Which template would you like to use?
✔  php


╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  EPERM: operation not permitted, copyfile                                    │
│  '/tmp/cb635eef29c31a10687f90a7693d4848/app/web/storage/logs/.gitignore' ->  │
│   '/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web/storage/lo  │
│  gs/.gitignore'                                                              │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

npm notice
npm notice New minor version of npm available! 9.5.1 -> 9.6.7
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.7
npm notice Run npm install -g npm@9.6.7 to update!
npm notice
npm ERR! code 1
npm ERR! path /mnt/e/wwwroot/shopify-app
npm ERR! command failed
npm ERR! command sh -c create-app

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/wangqiang/.npm/_logs/2023-06-02T03_46_50_520Z-debug-0.log
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$

3、在命令 npm init @shopify/app@latest 前添加 sudo,以提升权限,不再报错

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo npm init @shopify/app@latest

Welcome. Let’s get started by naming your app project. You can change it later.

?  Your app project name?
✔  learn-php-app-ubuntu-2004-0602

?  Which template would you like to use?
✔  php

4、参考:安装 PHP 、Composer

wangqiang@DESKTOP-QLPK8QM:~$ sudo apt install php
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfwupdplugin1 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libjansson4 liblua5.2-0 php-common php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache
  php7.4-readline ssl-cert
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear openssl-blacklist
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
Enabling module status.
Enabling module reqtimeout.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
info: Switch to mpm prefork for package libapache2-mod-php7.4
Module mpm_event disabled.
Enabling module mpm_prefork.
info: Executing deferred 'a2enmod php7.4' for package libapache2-mod-php7.4
Enabling module php7.4.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service.
invoke-rc.d: could not determine current runlevel
Setting up php7.4 (7.4.3-4ubuntu2.18) ...
Setting up php (2:7.4+75) ...
Processing triggers for ufw (0.36-6ubuntu1) ...
Processing triggers for systemd (245.4-4ubuntu3.21) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for php7.4-cli (7.4.3-4ubuntu2.18) ...
Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.18) ...
wangqiang@DESKTOP-QLPK8QM:~$ sudo apt install composer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfwupdplugin1 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  jsonlint libonig5 php-composer-ca-bundle php-composer-semver php-composer-spdx-licenses php-composer-xdebug-handler
  php-json-schema php-mbstring php-psr-container php-psr-log php-symfony-console php-symfony-filesystem
  php-symfony-finder php-symfony-process php-symfony-service-contracts php7.4-mbstring
Preparing to unpack .../16-composer_1.10.1-1_all.deb ...
Unpacking composer (1.10.1-1) ...
Setting up php-symfony-finder (4.3.8+dfsg-1ubuntu1) ...
Setting up jsonlint (1.7.2-1) ...
Setting up php-psr-container (1.0.0-2) ...
Setting up php-symfony-service-contracts (1.1.8-1) ...
Setting up php-composer-ca-bundle (1.2.6-1) ...
Setting up php-symfony-process (4.3.8+dfsg-1ubuntu1) ...
Setting up php-symfony-filesystem (4.3.8+dfsg-1ubuntu1) ...
Setting up php-psr-log (1.1.2-1) ...
Setting up php-composer-semver (1.5.1-1) ...
Setting up php-json-schema (5.2.9-1) ...
Setting up php-composer-spdx-licenses (1.5.3-1) ...
Setting up libonig5:amd64 (6.9.4-1) ...
Setting up php-composer-xdebug-handler (1.4.0-1) ...
Setting up php7.4-mbstring (7.4.3-4ubuntu2.18) ...

Creating config file /etc/php/7.4/mods-available/mbstring.ini with new version
Setting up php-mbstring (2:7.4+75) ...
Setting up php-symfony-console (4.3.8+dfsg-1ubuntu1) ...
Setting up composer (1.10.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.18) ...
Processing triggers for php7.4-cli (7.4.3-4ubuntu2.18) ...

5、创建应用程序后,设置 Laravel 应用程序。安装依赖包。提示:建议升级至 Composer 2。先卸载掉 Composer 1,再安装 Composer 2 。参考:后续使用:php composer.phar

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ composer install
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ composer -V
Composer 1.10.1 2020-03-13 20:34:27
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt-get remove composer
[sudo] password for wangqiang:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  jsonlint libfwupdplugin1 libonig5 libxmlb1 php-composer-ca-bundle php-composer-semver php-composer-spdx-licenses
  php-composer-xdebug-handler php-json-schema php-mbstring php-psr-container php-psr-log php-symfony-console
  php-symfony-filesystem php-symfony-finder php-symfony-process php-symfony-service-contracts php7.4-mbstring
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  composer
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 1996 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 66661 files and directories currently installed.)
Removing composer (1.10.1-1) ...
Processing triggers for man-db (2.9.1-1) ...
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ composer -V
-bash: /usr/bin/composer: No such file or directory
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Installer verified
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php composer-setup.php
All settings correct for using Composer
Downloading...

Composer (version 2.5.7) successfully installed to: /mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web/composer.phar
Use it: php composer.phar
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php composer.phar -V
Composer version 2.5.7 2023-05-24 15:00:39

6、提示:Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php composer.phar install
Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ apt-cache search php | grep cur
l
php-curl - CURL module for PHP [default]
php7.4-curl - CURL module for PHP
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt-get install php-curl
[sudo] password for wangqiang:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  jsonlint libfwupdplugin1 libonig5 libxmlb1 php-composer-ca-bundle php-composer-semver php-composer-spdx-licenses
  php-composer-xdebug-handler php-json-schema php-mbstring php-psr-container php-psr-log php-symfony-console
  php-symfony-filesystem php-symfony-finder php-symfony-process php-symfony-service-contracts php7.4-mbstring
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  php7.4-curl
The following NEW packages will be installed:
  php-curl php7.4-curl
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 32.9 kB of archives.
After this operation, 148 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-curl amd64 7.4.3-4ubuntu2.18 [30.9 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 php-curl all 2:7.4+75 [2000 B]
Fetched 32.9 kB in 2s (16.1 kB/s)
Selecting previously unselected package php7.4-curl.
(Reading database ... 66332 files and directories currently installed.)
Preparing to unpack .../php7.4-curl_7.4.3-4ubuntu2.18_amd64.deb ...
Unpacking php7.4-curl (7.4.3-4ubuntu2.18) ...
Selecting previously unselected package php-curl.
Preparing to unpack .../php-curl_2%3a7.4+75_all.deb ...
Unpacking php-curl (2:7.4+75) ...
Setting up php7.4-curl (7.4.3-4ubuntu2.18) ...

Creating config file /etc/php/7.4/mods-available/curl.ini with new version
Setting up php-curl (2:7.4+75) ...
Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.18) ...
Processing triggers for php7.4-cli (7.4.3-4ubuntu2.18) ...

7、Your requirements could not be resolved to an installable set of packages. 根 composer.json 需要 php ~8.0.0 || ~8.1.0 || ~8.2.0 但您的 php 版本 (7.4.3) 不满足该要求。一些必需的扩展也没有启用。

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php composer.phar install
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires php ~8.0.0 || ~8.1.0 || ~8.2.0 but your php version (7.4.3) does not satisfy that requirement.
  Problem 2
    - Root composer.json requires PHP extension ext-xml * but it is missing from your system. Install or enable PHP's xml extension.
  Problem 3
    - Root composer.json requires PHP extension ext-zip * but it is missing from your system. Install or enable PHP's zip extension.
  Problem 4
    - Root composer.json requires shopify/shopify-api ^5.0 -> satisfiable by shopify/shopify-api[v5.0.0].
    - shopify/shopify-api v5.0.0 requires php ~8.0.0 || ~8.1.0 || ~8.2.0 -> your php version (7.4.3) does not satisfy that requirement.
  Problem 5
    - Root composer.json requires squizlabs/php_codesniffer ^3.6 -> satisfiable by squizlabs/php_codesniffer[3.6.0, ..., 3.x-dev].
    - squizlabs/php_codesniffer[3.6.0, ..., 3.x-dev] require ext-xmlwriter * -> it is missing from your system. Install or enable PHP's xmlwriter extension.
  Problem 6
    - phpunit/phpunit[9.3.3, ..., 9.6.x-dev] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
    - Root composer.json requires phpunit/phpunit ^9.3.3 -> satisfiable by phpunit/phpunit[9.3.3, ..., 9.6.x-dev].

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.4/cli/php.ini
    - /etc/php/7.4/cli/conf.d/10-opcache.ini
    - /etc/php/7.4/cli/conf.d/10-pdo.ini
    - /etc/php/7.4/cli/conf.d/20-calendar.ini
    - /etc/php/7.4/cli/conf.d/20-ctype.ini
    - /etc/php/7.4/cli/conf.d/20-curl.ini
    - /etc/php/7.4/cli/conf.d/20-exif.ini
    - /etc/php/7.4/cli/conf.d/20-ffi.ini
    - /etc/php/7.4/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.4/cli/conf.d/20-ftp.ini
    - /etc/php/7.4/cli/conf.d/20-gettext.ini
    - /etc/php/7.4/cli/conf.d/20-iconv.ini
    - /etc/php/7.4/cli/conf.d/20-json.ini
    - /etc/php/7.4/cli/conf.d/20-mbstring.ini
    - /etc/php/7.4/cli/conf.d/20-phar.ini
    - /etc/php/7.4/cli/conf.d/20-posix.ini
    - /etc/php/7.4/cli/conf.d/20-readline.ini
    - /etc/php/7.4/cli/conf.d/20-shmop.ini
    - /etc/php/7.4/cli/conf.d/20-sockets.ini
    - /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.4/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.4/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.4/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-xml --ignore-platform-req=ext-zip --ignore-platform-req=ext-xmlwriter --ignore-platform-req=ext-dom` to temporarily ignore these required extensions.

8、参考:在 WSL2 中的 Ubuntu-20.04 中卸载 PHP 7.4,然后安装 PHP 8 

9、继续安装 Composer 依赖

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt-get install php8.1-curl
[sudo] password for wangqiang:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  php8.1-curl
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 33.6 kB of archives.
After this operation, 152 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.1-curl amd64 8.1.18-1+ubuntu20.04.1+deb.sury.org+1 [33.6 kB]
Fetched 33.6 kB in 2s (21.8 kB/s)
Selecting previously unselected package php8.1-curl.
(Reading database ... 65958 files and directories currently installed.)
Preparing to unpack .../php8.1-curl_8.1.18-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.1-curl (8.1.18-1+ubuntu20.04.1+deb.sury.org+1) ...
Setting up php8.1-curl (8.1.18-1+ubuntu20.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.1/mods-available/curl.ini with new version
Processing triggers for libapache2-mod-php8.1 (8.1.18-1+ubuntu20.04.1+deb.sury.org+1) ...
Processing triggers for php8.1-cli (8.1.18-1+ubuntu20.04.1+deb.sury.org+1) ...
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php composer.phar install
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires PHP extension ext-xml * but it is missing from your system. Install or enable PHP's xml extension.
  Problem 2
    - Root composer.json requires PHP extension ext-zip * but it is missing from your system. Install or enable PHP's zip extension.
  Problem 3
    - Root composer.json requires squizlabs/php_codesniffer ^3.6 -> satisfiable by squizlabs/php_codesniffer[3.6.0, ..., 3.x-dev].
    - squizlabs/php_codesniffer[3.6.0, ..., 3.x-dev] require ext-xmlwriter * -> it is missing from your system. Install or enable PHP's xmlwriter extension.
  Problem 4
    - phpunit/phpunit[9.3.3, ..., 9.6.x-dev] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
    - Root composer.json requires phpunit/phpunit ^9.3.3 -> satisfiable by phpunit/phpunit[9.3.3, ..., 9.6.x-dev].

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/8.1/cli/php.ini
    - /etc/php/8.1/cli/conf.d/10-opcache.ini
    - /etc/php/8.1/cli/conf.d/10-pdo.ini
    - /etc/php/8.1/cli/conf.d/20-calendar.ini
    - /etc/php/8.1/cli/conf.d/20-ctype.ini
    - /etc/php/8.1/cli/conf.d/20-curl.ini
    - /etc/php/8.1/cli/conf.d/20-exif.ini
    - /etc/php/8.1/cli/conf.d/20-ffi.ini
    - /etc/php/8.1/cli/conf.d/20-fileinfo.ini
    - /etc/php/8.1/cli/conf.d/20-ftp.ini
    - /etc/php/8.1/cli/conf.d/20-gettext.ini
    - /etc/php/8.1/cli/conf.d/20-iconv.ini
    - /etc/php/8.1/cli/conf.d/20-phar.ini
    - /etc/php/8.1/cli/conf.d/20-posix.ini
    - /etc/php/8.1/cli/conf.d/20-readline.ini
    - /etc/php/8.1/cli/conf.d/20-shmop.ini
    - /etc/php/8.1/cli/conf.d/20-sockets.ini
    - /etc/php/8.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/8.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/8.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/8.1/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-xml --ignore-platform-req=ext-zip --ignore-platform-req=ext-xmlwriter --ignore-platform-req=ext-dom` to temporarily ignore these required extensions.
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt-get install php8.1-xml
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt-get install php8.1-zip
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo php compos
er.phar install
[sudo] password for wangqiang:
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 114 installs, 0 updates, 0 removals
  - Downloading brick/math (0.11.0)
  - Downloading psr/log (2.0.0)
  - Downloading psr/cache (3.0.0)
  - Downloading doctrine/event-manager (2.0.0)
  - Downloading doctrine/deprecations (v1.1.0)
  - Downloading doctrine/cache (2.2.0)
  - Downloading doctrine/dbal (3.6.2)
  - Downloading doctrine/lexer (1.2.3)
  - Downloading symfony/polyfill-ctype (v1.27.0)
  - Downloading webmozart/assert (1.11.0)
  - Downloading dragonmantank/cron-expression (v3.3.2)
  - Downloading symfony/polyfill-php80 (v1.27.0)
  - Downloading symfony/polyfill-mbstring (v1.27.0)
  - Downloading symfony/var-dumper (v5.4.24)
  - Downloading symfony/polyfill-intl-normalizer (v1.27.0)
  - Downloading symfony/polyfill-intl-grapheme (v1.27.0)
  - Downloading symfony/string (v6.3.0)
  - Downloading symfony/deprecation-contracts (v3.3.0)
  - Downloading psr/container (1.1.2)
  - Downloading symfony/service-contracts (v2.5.2)
  - Downloading symfony/polyfill-php73 (v1.27.0)
  - Downloading symfony/console (v5.4.24)
  - Downloading monolog/monolog (2.9.1)
  - Downloading voku/portable-ascii (1.6.1)
  - Downloading phpoption/phpoption (1.9.1)
  - Downloading graham-campbell/result-type (v1.1.1)
  - Downloading vlucas/phpdotenv (v5.5.0)
  - Downloading symfony/css-selector (v6.3.0)
  - Downloading tijsverkoyen/css-to-inline-styles (2.2.6)
  - Downloading symfony/routing (v5.4.22)
  - Downloading symfony/process (v5.4.24)
  - Downloading symfony/polyfill-php72 (v1.27.0)
  - Downloading symfony/polyfill-intl-idn (v1.27.0)
  - Downloading symfony/mime (v5.4.23)
  - Downloading symfony/http-foundation (v5.4.24)
  - Downloading psr/event-dispatcher (1.0.0)
  - Downloading symfony/event-dispatcher-contracts (v3.3.0)
  - Downloading symfony/event-dispatcher (v6.3.0)
  - Downloading symfony/error-handler (v5.4.24)
  - Downloading symfony/http-kernel (v5.4.24)
  - Downloading symfony/finder (v5.4.21)
  - Downloading symfony/polyfill-iconv (v1.27.0)
  - Downloading egulias/email-validator (2.1.25)
  - Downloading swiftmailer/swiftmailer (v6.3.0)
  - Downloading ramsey/collection (2.0.0)
  - Downloading ramsey/uuid (4.7.4)
  - Downloading psr/simple-cache (1.0.1)
  - Downloading opis/closure (3.6.3)
  - Downloading symfony/translation-contracts (v3.3.0)
  - Downloading symfony/translation (v6.3.0)
  - Downloading nesbot/carbon (2.67.0)
  - Downloading league/mime-type-detection (1.11.0)
  - Downloading league/flysystem (1.1.10)
  - Downloading nette/utils (v4.0.0)
  - Downloading nette/schema (v1.2.3)
  - Downloading dflydev/dot-access-data (v3.0.2)
  - Downloading league/config (v1.2.0)
  - Downloading league/commonmark (2.4.0)
  - Downloading laravel/serializable-closure (v1.3.0)
  - Downloading doctrine/inflector (2.0.6)
  - Downloading laravel/framework (v8.83.27)
  - Downloading facade/ignition-contracts (1.0.2)
  - Downloading facade/flare-client-php (1.10.0)
  - Downloading facade/ignition (2.17.7)
  - Downloading fakerphp/faker (v1.22.0)
  - Downloading fideloper/proxy (4.4.2)
  - Downloading fruitcake/php-cors (v1.2.0)
  - Downloading fruitcake/laravel-cors (v3.0.0)
  - Downloading guzzlehttp/promises (2.0.0)
  - Downloading symfony/yaml (v6.3.0)
  - Downloading laravel/sail (v1.22.0)
  - Downloading nikic/php-parser (v4.15.5)
  - Downloading psy/psysh (v0.11.18)
  - Downloading laravel/tinker (v2.8.1)
  - Downloading hamcrest/hamcrest-php (v2.0.1)
  - Downloading mockery/mockery (1.5.1)
  - Downloading filp/whoops (2.15.2)
  - Downloading nunomaduro/collision (v5.11.0)
  - Downloading sebastian/version (3.0.2)
  - Downloading sebastian/type (3.2.1)
  - Downloading sebastian/resource-operations (3.0.3)
  - Downloading sebastian/recursion-context (4.0.5)
  - Downloading sebastian/object-reflector (2.0.4)
  - Downloading sebastian/object-enumerator (4.0.4)
  - Downloading sebastian/global-state (5.0.5)
  - Downloading sebastian/exporter (4.0.5)
  - Downloading sebastian/environment (5.1.5)
  - Downloading sebastian/diff (4.0.5)
  - Downloading sebastian/comparator (4.0.8)
  - Downloading sebastian/code-unit (1.0.8)
  - Downloading sebastian/cli-parser (1.0.1)
  - Downloading phpunit/php-timer (5.0.3)
  - Downloading phpunit/php-text-template (2.0.4)
  - Downloading phpunit/php-invoker (3.1.1)
  - Downloading phpunit/php-file-iterator (3.0.6)
  - Downloading theseer/tokenizer (1.2.1)
  - Downloading sebastian/lines-of-code (1.0.3)
  - Downloading sebastian/complexity (2.0.2)
  - Downloading sebastian/code-unit-reverse-lookup (2.0.3)
  - Downloading phpunit/php-code-coverage (9.2.26)
  - Downloading phar-io/version (3.2.1)
  - Downloading phar-io/manifest (2.0.3)
  - Downloading myclabs/deep-copy (1.11.1)
  - Downloading doctrine/instantiator (2.0.0)
  - Downloading phpunit/phpunit (9.6.8)
  - Downloading psr/http-message (1.1)
  - Downloading psr/http-factory (1.0.2)
  - Downloading ralouphie/getallheaders (3.0.3)
  - Downloading psr/http-client (1.0.2)
  - Downloading guzzlehttp/psr7 (2.5.0)
  - Downloading guzzlehttp/guzzle (7.7.0)
  - Downloading firebase/php-jwt (v6.5.0)
  - Downloading shopify/shopify-api (v5.0.0)
  - Downloading squizlabs/php_codesniffer (3.7.2)
  - Installing brick/math (0.11.0): Extracting archive
  - Installing psr/log (2.0.0): Extracting archive
  - Installing psr/cache (3.0.0): Extracting archive
  - Installing doctrine/event-manager (2.0.0): Extracting archive
  - Installing doctrine/deprecations (v1.1.0): Extracting archive
  - Installing doctrine/cache (2.2.0): Extracting archive
  - Installing doctrine/dbal (3.6.2): Extracting archive
  - Installing doctrine/lexer (1.2.3): Extracting archive
  - Installing symfony/polyfill-ctype (v1.27.0): Extracting archive
  - Installing webmozart/assert (1.11.0): Extracting archive
  - Installing dragonmantank/cron-expression (v3.3.2): Extracting archive
  - Installing symfony/polyfill-php80 (v1.27.0): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.27.0): Extracting archive
  - Installing symfony/var-dumper (v5.4.24): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.27.0): Extracting archive
  - Installing symfony/polyfill-intl-grapheme (v1.27.0): Extracting archive
  - Installing symfony/string (v6.3.0): Extracting archive
  - Installing symfony/deprecation-contracts (v3.3.0): Extracting archive
  - Installing psr/container (1.1.2): Extracting archive
  - Installing symfony/service-contracts (v2.5.2): Extracting archive
  - Installing symfony/polyfill-php73 (v1.27.0): Extracting archive
  - Installing symfony/console (v5.4.24): Extracting archive
  - Installing monolog/monolog (2.9.1): Extracting archive
  - Installing voku/portable-ascii (1.6.1): Extracting archive
  - Installing phpoption/phpoption (1.9.1): Extracting archive
  - Installing graham-campbell/result-type (v1.1.1): Extracting archive
  - Installing vlucas/phpdotenv (v5.5.0): Extracting archive
  - Installing symfony/css-selector (v6.3.0): Extracting archive
  - Installing tijsverkoyen/css-to-inline-styles (2.2.6): Extracting archive
  - Installing symfony/routing (v5.4.22): Extracting archive
  - Installing symfony/process (v5.4.24): Extracting archive
  - Installing symfony/polyfill-php72 (v1.27.0): Extracting archive
  - Installing symfony/polyfill-intl-idn (v1.27.0): Extracting archive
  - Installing symfony/mime (v5.4.23): Extracting archive
  - Installing symfony/http-foundation (v5.4.24): Extracting archive
  - Installing psr/event-dispatcher (1.0.0): Extracting archive
  - Installing symfony/event-dispatcher-contracts (v3.3.0): Extracting archive
  - Installing symfony/event-dispatcher (v6.3.0): Extracting archive
  - Installing symfony/error-handler (v5.4.24): Extracting archive
  - Installing symfony/http-kernel (v5.4.24): Extracting archive
  - Installing symfony/finder (v5.4.21): Extracting archive
  - Installing symfony/polyfill-iconv (v1.27.0): Extracting archive
  - Installing egulias/email-validator (2.1.25): Extracting archive
  - Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
  - Installing ramsey/collection (2.0.0): Extracting archive
  - Installing ramsey/uuid (4.7.4): Extracting archive
  - Installing psr/simple-cache (1.0.1): Extracting archive
  - Installing opis/closure (3.6.3): Extracting archive
  - Installing symfony/translation-contracts (v3.3.0): Extracting archive
  - Installing symfony/translation (v6.3.0): Extracting archive
  - Installing nesbot/carbon (2.67.0): Extracting archive
  - Installing league/mime-type-detection (1.11.0): Extracting archive
  - Installing league/flysystem (1.1.10): Extracting archive
  - Installing nette/utils (v4.0.0): Extracting archive
  - Installing nette/schema (v1.2.3): Extracting archive
  - Installing dflydev/dot-access-data (v3.0.2): Extracting archive
  - Installing league/config (v1.2.0): Extracting archive
  - Installing league/commonmark (2.4.0): Extracting archive
  - Installing laravel/serializable-closure (v1.3.0): Extracting archive
  - Installing doctrine/inflector (2.0.6): Extracting archive
  - Installing laravel/framework (v8.83.27): Extracting archive
  - Installing facade/ignition-contracts (1.0.2): Extracting archive
  - Installing facade/flare-client-php (1.10.0): Extracting archive
  - Installing facade/ignition (2.17.7): Extracting archive
  - Installing fakerphp/faker (v1.22.0): Extracting archive
  - Installing fideloper/proxy (4.4.2): Extracting archive
  - Installing fruitcake/php-cors (v1.2.0): Extracting archive
  - Installing fruitcake/laravel-cors (v3.0.0): Extracting archive
  - Installing guzzlehttp/promises (2.0.0): Extracting archive
  - Installing symfony/yaml (v6.3.0): Extracting archive
  - Installing laravel/sail (v1.22.0): Extracting archive
  - Installing nikic/php-parser (v4.15.5): Extracting archive
  - Installing psy/psysh (v0.11.18): Extracting archive
  - Installing laravel/tinker (v2.8.1): Extracting archive
  - Installing hamcrest/hamcrest-php (v2.0.1): Extracting archive
  - Installing mockery/mockery (1.5.1): Extracting archive
  - Installing filp/whoops (2.15.2): Extracting archive
  - Installing nunomaduro/collision (v5.11.0): Extracting archive
  - Installing sebastian/version (3.0.2): Extracting archive
  - Installing sebastian/type (3.2.1): Extracting archive
  - Installing sebastian/resource-operations (3.0.3): Extracting archive
  - Installing sebastian/recursion-context (4.0.5): Extracting archive
  - Installing sebastian/object-reflector (2.0.4): Extracting archive
  - Installing sebastian/object-enumerator (4.0.4): Extracting archive
  - Installing sebastian/global-state (5.0.5): Extracting archive
  - Installing sebastian/exporter (4.0.5): Extracting archive
  - Installing sebastian/environment (5.1.5): Extracting archive
  - Installing sebastian/diff (4.0.5): Extracting archive
  - Installing sebastian/comparator (4.0.8): Extracting archive
  - Installing sebastian/code-unit (1.0.8): Extracting archive
  - Installing sebastian/cli-parser (1.0.1): Extracting archive
  - Installing phpunit/php-timer (5.0.3): Extracting archive
  - Installing phpunit/php-text-template (2.0.4): Extracting archive
  - Installing phpunit/php-invoker (3.1.1): Extracting archive
  - Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  - Installing theseer/tokenizer (1.2.1): Extracting archive
  - Installing sebastian/lines-of-code (1.0.3): Extracting archive
  - Installing sebastian/complexity (2.0.2): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  - Installing phpunit/php-code-coverage (9.2.26): Extracting archive
  - Installing phar-io/version (3.2.1): Extracting archive
  - Installing phar-io/manifest (2.0.3): Extracting archive
  - Installing myclabs/deep-copy (1.11.1): Extracting archive
  - Installing doctrine/instantiator (2.0.0): Extracting archive
  - Installing phpunit/phpunit (9.6.8): Extracting archive
  - Installing psr/http-message (1.1): Extracting archive
  - Installing psr/http-factory (1.0.2): Extracting archive
  - Installing ralouphie/getallheaders (3.0.3): Extracting archive
  - Installing psr/http-client (1.0.2): Extracting archive
  - Installing guzzlehttp/psr7 (2.5.0): Extracting archive
  - Installing guzzlehttp/guzzle (7.7.0): Extracting archive
  - Installing firebase/php-jwt (v6.5.0): Extracting archive
  - Installing shopify/shopify-api (v5.0.0): Extracting archive
  - Installing squizlabs/php_codesniffer (3.7.2): Extracting archive
Package fruitcake/laravel-cors is abandoned, you should avoid using it. No replacement was suggested.
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel/sail
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
81 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

10、安装 MySQL,参考:进入数据库

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt install mysql-server
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ mysql --version
mysql  Ver 8.0.33-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo /etc/init.d/mysql start
 * Starting MySQL database server mysqld                                                                su: warning: cannot change directory to /nonexistent: No such file or directory
                                                                                                 [ OK ]
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.33-0ubuntu0.20.04.2 (Ubuntu)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> CREATE DATABASE learn_php_app_ubuntu_2004_0602;
Query OK, 1 row affected (0.01 sec)

mysql> SHOW DATABASES;
+--------------------------------+
| Database                       |
+--------------------------------+
| information_schema             |
| learn_php_app_ubuntu_2004_0602 |
| mysql                          |
| performance_schema             |
| sys                            |
+--------------------------------+
5 rows in set (0.00 sec)

mysql>

11、编辑 .env

APP_NAME="Shopify PHP App Ubuntu-20.04"
APP_ENV=local
APP_KEY=
APP_DEBUG=true

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=learn_php_app_ubuntu_2004_0602
DB_USERNAME=
DB_PASSWORD=

12、执行数据库迁移命令时报错:Access denied for user ”@’localhost’ (using password: NO)

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php artisan migrate

   Illuminate\Database\QueryException

  SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table_schema = learn_php_app_ubuntu_2004_0602 and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
    708▕         // If an exception occurs when attempting to run a query, we'll format the error
    709▕         // message to include the bindings with SQL, which will make this exception a
    710▕         // lot more helpful to the developer instead of just the database's errors.
    711▕         catch (Exception $e) {
  ➜ 712▕             throw new QueryException(
    713▕                 $query, $this->prepareBindings($bindings), $e
    714▕             );
    715▕         }
    716▕     }

      +33 vendor frames
  34  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

13、启动安全脚本提示符:sudo mysql_secure_installation 时,设置密码时提示:Failed! Error: SET PASSWORD has no significance for user ‘root’@’localhost’ as the authentication method used doesn’t store authentication data in the MySQL server.

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.
The 'validate_password' component is installed on the server.
The subsequent steps will run with the existing configuration
of the component.
Please set the password for root here.

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y
 ... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.

14、执行:sudo cat /etc/mysql/debian.cnf,使用文件中的用户名与密码重新设置 .env ,执行数据库迁移成功

APP_NAME="Shopify PHP App Ubuntu-20.04"
APP_ENV=local
APP_KEY=base64:YFa6CcsSTZ4d0u62FbrCmehnoEx9q9bM5OnqjnAxdeU=
APP_DEBUG=true

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=learn_php_app_ubuntu_2004_0602
DB_USERNAME=debian-sys-maint
DB_PASSWORD=nGWMLgJjXnsnhm7t

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php artisan migrate
Migration table created successfully.
Migrating: 2019_08_19_000000_create_failed_jobs_table
Migrated:  2019_08_19_000000_create_failed_jobs_table (106.88ms)
Migrating: 2021_05_03_050717_create_sessions_table
Migrated:  2021_05_03_050717_create_sessions_table (45.18ms)
Migrating: 2021_05_05_071311_add_scope_expires_access_token_to_sessions
Migrated:  2021_05_05_071311_add_scope_expires_access_token_to_sessions (27.42ms)
Migrating: 2021_05_11_151158_add_online_access_info_to_sessions
Migrated:  2021_05_11_151158_add_online_access_info_to_sessions (23.57ms)
Migrating: 2021_05_17_152611_change_sessions_user_id_type
Migrated:  2021_05_17_152611_change_sessions_user_id_type (630.37ms)

15、启动本地服务器,回到根目录,执行:npm run dev,报错,怀疑是第 3 步骤未执行彻底导致的问题。因为在第 3 步骤未提示:success

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602$ npm run dev

> learn-php-app-ubuntu-2004-0602@1.0.0 dev
> shopify app dev

?  Command `app dev` not found. Did you mean `theme dev`?
✔  Yes, confirm

╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  A store is required                                                         │
│                                                                              │
│  Specify the store passing --store={your_store_url} or set the               │
│  SHOPIFY_FLAG_STORE environment variable.                                    │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602$

16、从头开始新建应用:learn-php-app-ubuntu-2004-0605,需要耐心等待一段时间,不要中途给中止了。如图1

从头开始新建应用:learn-php-app-ubuntu-2004-0605,需要耐心等待一段时间,不要中途给中止了

图1

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo npm init @shopify/app@latest

Welcome. Let’s get started by naming your app project. You can change it later.

?  Your app project name?
✔  learn-php-app-ubuntu-2004-0605

?  Which template would you like to use?
✔  php


╭─ success ────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  learn-php-app-ubuntu-2004-0605 is ready for you to build!                   │
│                                                                              │
│  Next steps                                                                  │
│    • Run `cd learn-php-app-ubuntu-2004-0605`                                 │
│    • For extensions, run `npm run generate extension`                        │
│    • To see your app, run `npm run dev`                                      │
│                                                                              │
│  Reference                                                                   │
│    • Shopify docs [1]                                                        │
│    • For an overview of commands, run `npm run shopify app -- --help`        │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
[1] https://shopify.dev

17、再次从第 4 步骤开始操作,一些步骤可以跳过。执行第 15 步骤,报错:To investigate the issue, examine this stack trace。重新执行即可。进入安装应用。如图2

再次从第 4 步骤开始操作,一些步骤可以跳过。执行第 15 步骤,报错:To investigate the issue, examine this stack trace。重新执行即可。进入安装应用

图2

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605$ composer -V
Composer version 2.5.5 2023-03-21 11:50:05
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605/web$ composer install
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605/web$ cp .env.example .env
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605/web$ php artisan key:generate
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605/web$ php artisan migrate
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605$ npm run dev

> learn-php-app-ubuntu-2004-0605@1.0.0 dev
> shopify app dev


To run this command, log in to Shopify Partners.
👉 Press any key to open the login page on your browser

Auto-open timed out. Open the login page: Log in to Shopify Partners ( http://accounts.shopify.com/oauth/authorize?client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&scope=openid+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.graphql+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.themes+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.storefront-renderer.devtools+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.app.cli.access&redirect_uri=http%3A%2F%2F127.0.0.1%3A3456&state=5cba6732fe773fac2a7e9a95ddf3ab686b3a9b7231168d58f339f17dcaa1&response_type=code&code_challenge_method=S256&code_challenge=gozZ6hqQIOzwYdzxuX2RaOUgpaRz9A8gUlUoC6Wy6Vw )

✔ Logged in.

Looks like this is the first time you're running dev for this project.
Configure your preferences by answering a few questions.


Before you preview your work, it needs to be associated with an app.

?  Create this project as a new app on Shopify?
✔  Yes, create it as a new app

?  App name:
✔  learn-php-app-ubuntu-2004-0605

✔ Using your default dev store (shuijingwanwq-development) to preview your project.
╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│                                                                              │
│  To investigate the issue, examine this stack trace:                         │
│    at pollTunnelStatus (@shopify/app/src/cli/services/dev/urls.ts:106)       │
│      if (result.status === 'error') return reject(new                        │
│      BugError(result.message))                                               │
│    at (@shopify/app/src/cli/services/dev/urls.ts:120)                        │
│      pollTunnelStatus()                                                      │
│    at new Promise                                                            │
│    at pollTunnelURL (@shopify/app/src/cli/services/dev/urls.ts:101)          │
│      return new Promise<string>((resolve, reject) => {                       │
│    at generateFrontendURL (@shopify/app/src/cli/services/dev/urls.ts:89)     │
│      const url = await pollTunnelURL(options.tunnelClient)                   │
│    at dev (@shopify/app/src/cli/services/dev.ts:121)                         │
│      generateFrontendURL({                                                   │
│    at run (@shopify/app/src/cli/commands/app/dev.ts:106)                     │
│      await dev({                                                             │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0605$ npm run dev

> learn-php-app-ubuntu-2004-0605@1.0.0 dev
> shopify app dev

╭─ info ───────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Using your previous dev settings:                                           │
│                                                                              │
│    • Org:          王强                                                      │
│    • App:          learn-php-app-ubuntu-2004-0605                            │
│    • Dev store:    shuijingwanwq-development.myshopify.com                   │
│    • Update URLs:  Not yet configured                                        │
│                                                                              │
│  To reset your default dev config, run `npm run dev -- --reset`              │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

?  Have Shopify automatically update your app's URL in order to create a preview experience?
✔  Always by default

2023-06-06 01:51:12 │ frontend │
2023-06-06 01:51:12 │ frontend │ > shopify-frontend-template-react@1.0.0 dev
2023-06-06 01:51:12 │ frontend │ > vite
2023-06-06 01:51:12 │ frontend │
2023-06-06 01:51:18 │ backend  │ > Composer\Config::disableProcessTimeout
2023-06-06 01:51:18 │ backend  │ > php artisan serve
2023-06-06 01:51:20 │ frontend │
2023-06-06 01:51:20 │ frontend │   VITE v4.3.9  ready in 7780 ms
2023-06-06 01:51:20 │ frontend │
2023-06-06 01:51:20 │ frontend │   ➜  Local:   http://localhost:33597/
2023-06-06 01:51:26 │ backend  │ Starting Laravel development server: http://127.0.0.1:44681
2023-06-06 01:51:27 │ backend  │ [Tue Jun  6 09:51:26 2023] PHP 8.1.18 Development Server (http://127.0.0.1:44681) started
2023-06-06 01:51:47 │ backend  │ [Tue Jun  6 09:51:47 2023] 127.0.0.1:34304 Accepted
2023-06-06 01:51:54 │ backend  │ [Tue Jun  6 09:51:54 2023] 127.0.0.1:34304 Closing
2023-06-06 01:51:54 │ backend  │ [Tue Jun  6 09:51:54 2023] 127.0.0.1:34310 Accepted
2023-06-06 01:51:56 │ backend  │ [Tue Jun  6 09:51:56 2023] 127.0.0.1:34310 Closing
2023-06-06 01:53:17 │ backend  │ [Tue Jun  6 09:53:17 2023] 127.0.0.1:34320 Accepted
2023-06-06 01:53:22 │ backend  │ [Tue Jun  6 09:53:22 2023] 127.0.0.1:34320 Closing
2023-06-06 01:53:22 │ backend  │ [Tue Jun  6 09:53:22 2023] 127.0.0.1:34326 Accepted
2023-06-06 01:53:26 │ backend  │ [Tue Jun  6 09:53:25 2023] 127.0.0.1:34326 Closing

› Press p │ preview in your browser
› Press q │ quit

Preview URL: https://instructional-attend-excellent-gig.trycloudflare.com?shop=shuijingwanwq-development.myshopify.com&h
ost=c2h1aWppbmd3YW53cS1kZXZlbG9wbWVudC5teXNob3BpZnkuY29tL2FkbWlu

18、安装应用时报错:Shopify\Exception\CookieNotFoundException Could not find the current session id in the cookies。如图3

安装应用时报错:Shopify\Exception\CookieNotFoundException Could not find the current session id in the cookies

图3

19、再次运行:npm run dev,打开浏览器,不再报错。如图4

再次运行:npm run dev,打开浏览器,不再报错

图4

]]>
https://www.shuijingwanwq.com/2023/07/01/7792/feed/ 1
在 WSL2 中的 Ubuntu-20.04 中卸载 PHP 7.4,然后安装 PHP 8 https://www.shuijingwanwq.com/2023/06/30/7789/ https://www.shuijingwanwq.com/2023/06/30/7789/#comments Fri, 30 Jun 2023 01:23:00 +0000 https://www.shuijingwanwq.com/?p=7789 浏览量: 183 1、参考:安装 PHP,其版本默认为 PHP 7.4


wangqiang@DESKTOP-QLPK8QM:~$ sudo apt install php
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libfwupdplugin1 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libjansson4 liblua5.2-0 php-common php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache
  php7.4-readline ssl-cert
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear openssl-blacklist
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.4 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
Enabling module status.
Enabling module reqtimeout.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
info: Switch to mpm prefork for package libapache2-mod-php7.4
Module mpm_event disabled.
Enabling module mpm_prefork.
info: Executing deferred 'a2enmod php7.4' for package libapache2-mod-php7.4
Enabling module php7.4.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service.
invoke-rc.d: could not determine current runlevel
Setting up php7.4 (7.4.3-4ubuntu2.18) ...
Setting up php (2:7.4+75) ...
Processing triggers for ufw (0.36-6ubuntu1) ...
Processing triggers for systemd (245.4-4ubuntu3.21) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for php7.4-cli (7.4.3-4ubuntu2.18) ...
Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.18) ...


2、先卸载掉 PHP 7.4 及其依赖


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt-get purge php7.*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php7.4-ds' for glob 'php7.*'
Note, selecting 'php7.4-bz2' for glob 'php7.*'
Note, selecting 'php7.4-gd' for glob 'php7.*'
Note, selecting 'php7.4-ps' for glob 'php7.*'
Note, selecting 'php7.4-cgi' for glob 'php7.*'
Note, selecting 'php7.4-cli' for glob 'php7.*'
Note, selecting 'php7.4-uuid' for glob 'php7.*'
Note, selecting 'php7.4-pdo-odbc' for glob 'php7.*'
Note, selecting 'php7.4-dba' for glob 'php7.*'
Note, selecting 'php7.4-dev' for glob 'php7.*'
Note, selecting 'php7.4-dom' for glob 'php7.*'
Note, selecting 'php7.4-tidy' for glob 'php7.*'
Note, selecting 'php7.4-ffi' for glob 'php7.*'
Note, selecting 'php7.4-pcov' for glob 'php7.*'
Note, selecting 'php7.0-thrift' for glob 'php7.*'
Note, selecting 'php7.4-fpm' for glob 'php7.*'
Note, selecting 'php7.4-ftp' for glob 'php7.*'
Note, selecting 'php7.4-xmlreader' for glob 'php7.*'
Note, selecting 'php7.4-gmp' for glob 'php7.*'
Note, selecting 'php7.4-mysqli' for glob 'php7.*'
Note, selecting 'php7.4-imagick' for glob 'php7.*'
Note, selecting 'php7.4-sybase' for glob 'php7.*'
Note, selecting 'php7.4-sysvmsg' for glob 'php7.*'
Note, selecting 'php7.4-mongodb' for glob 'php7.*'
Note, selecting 'php7.4-json' for glob 'php7.*'
Note, selecting 'php7.2-sodium' for glob 'php7.*'
Note, selecting 'php7.4-sass' for glob 'php7.*'
Note, selecting 'php7.4-phar' for glob 'php7.*'
Note, selecting 'php7.4-tokenizer' for glob 'php7.*'
Note, selecting 'php7.4-igbinary' for glob 'php7.*'
Note, selecting 'php7.4-pgsql' for glob 'php7.*'
Note, selecting 'php7.4-lua' for glob 'php7.*'
Note, selecting 'php7.4-curl' for glob 'php7.*'
Note, selecting 'php7.4-phpdbg' for glob 'php7.*'
Note, selecting 'php7.4-memcache' for glob 'php7.*'
Note, selecting 'php7.4' for glob 'php7.*'
Note, selecting 'php7.4-interbase' for glob 'php7.*'
Note, selecting 'php7.4-shmop' for glob 'php7.*'
Note, selecting 'php7.4-ldap' for glob 'php7.*'
Note, selecting 'php7.4-radius' for glob 'php7.*'
Note, selecting 'php7.4-pdo-mysql' for glob 'php7.*'
Note, selecting 'php7.4-sysvsem' for glob 'php7.*'
Note, selecting 'php7.4-sysvshm' for glob 'php7.*'
Note, selecting 'php7.4-apcu-bc' for glob 'php7.*'
Note, selecting 'php7.0-common' for glob 'php7.*'
Note, selecting 'php7.4-uploadprogress' for glob 'php7.*'
Note, selecting 'php7.4-pdo' for glob 'php7.*'
Note, selecting 'php7.4-psr' for glob 'php7.*'
Note, selecting 'php7.4-imap' for glob 'php7.*'
Note, selecting 'php7.4-sockets' for glob 'php7.*'
Note, selecting 'php7.4-ctype' for glob 'php7.*'
Note, selecting 'php7.4-calendar' for glob 'php7.*'
Note, selecting 'php7.4-intl' for glob 'php7.*'
Note, selecting 'php7.4-rrd' for glob 'php7.*'
Note, selecting 'php7.4-fileinfo' for glob 'php7.*'
Note, selecting 'php7.4-geoip' for glob 'php7.*'
Note, selecting 'php7.4-sqlite3' for glob 'php7.*'
Note, selecting 'php7.4-odbc' for glob 'php7.*'
Note, selecting 'php7.4-pdo-dblib' for glob 'php7.*'
Note, selecting 'php7.4-xmlrpc' for glob 'php7.*'
Note, selecting 'php7.4-redis' for glob 'php7.*'
Note, selecting 'php7.4-yaml' for glob 'php7.*'
Note, selecting 'php7.4-opcache' for glob 'php7.*'
Note, selecting 'php7.4-snmp' for glob 'php7.*'
Note, selecting 'php7.4-soap' for glob 'php7.*'
Note, selecting 'php7.4-xml' for glob 'php7.*'
Note, selecting 'php7.4-solr' for glob 'php7.*'
Note, selecting 'php7.4-xsl' for glob 'php7.*'
Note, selecting 'php7.4-yac' for glob 'php7.*'
Note, selecting 'php7.4-oauth' for glob 'php7.*'
Note, selecting 'php7.4-zip' for glob 'php7.*'
Note, selecting 'php7.4-zmq' for glob 'php7.*'
Note, selecting 'php7.4-pinba' for glob 'php7.*'
Note, selecting 'php7.4-msgpack' for glob 'php7.*'
Note, selecting 'php7.4-simplexml' for glob 'php7.*'
Note, selecting 'php7.4-gearman' for glob 'php7.*'
Note, selecting 'php7.4-ssh2' for glob 'php7.*'
Note, selecting 'php7.4-pspell' for glob 'php7.*'
Note, selecting 'php7.0-curl' for glob 'php7.*'
Note, selecting 'php7.4-mysql' for glob 'php7.*'
Note, selecting 'php7.4-propro' for glob 'php7.*'
Note, selecting 'php7.4-mbstring' for glob 'php7.*'
Note, selecting 'php7.4-readline' for glob 'php7.*'
Note, selecting 'php7.4-amqp' for glob 'php7.*'
Note, selecting 'php7.4-pdo-firebird' for glob 'php7.*'
Note, selecting 'php7.2-thrift' for glob 'php7.*'
Note, selecting 'php7.4-apcu' for glob 'php7.*'
Note, selecting 'php7.4-exif' for glob 'php7.*'
Note, selecting 'php7.4-xdebug' for glob 'php7.*'
Note, selecting 'php7.4-memcached' for glob 'php7.*'
Note, selecting 'php7.4-mysqlnd' for glob 'php7.*'
Note, selecting 'php7.4-http' for glob 'php7.*'
Note, selecting 'php7.4-pdo-sqlite' for glob 'php7.*'
Note, selecting 'php7.4-common' for glob 'php7.*'
Note, selecting 'php7.4-stomp' for glob 'php7.*'
Note, selecting 'php7.4-raphf' for glob 'php7.*'
Note, selecting 'php7.4-bcmath' for glob 'php7.*'
Note, selecting 'php7.4-mailparse' for glob 'php7.*'
Note, selecting 'php7.4-tideways' for glob 'php7.*'
Note, selecting 'php7.4-gnupg' for glob 'php7.*'
Note, selecting 'php7.4-pdo-pgsql' for glob 'php7.*'
Note, selecting 'php7.4-posix' for glob 'php7.*'
Note, selecting 'php7.4-iconv' for glob 'php7.*'
Note, selecting 'php7.4-gmagick' for glob 'php7.*'
Note, selecting 'php7.4-enchant' for glob 'php7.*'
Note, selecting 'php7.4-gettext' for glob 'php7.*'
Note, selecting 'php7.4-xmlwriter' for glob 'php7.*'
Package 'php7.0-common' is not installed, so not removed
Package 'php7.0-curl' is not installed, so not removed
Package 'php7.2-sodium' is not installed, so not removed
Note, selecting 'php7.4-common' instead of 'php7.4-calendar'
Note, selecting 'php7.4-common' instead of 'php7.4-ctype'
Note, selecting 'php7.4-common' instead of 'php7.4-exif'
Note, selecting 'php7.4-common' instead of 'php7.4-ffi'
Note, selecting 'php7.4-common' instead of 'php7.4-fileinfo'
Note, selecting 'php7.4-common' instead of 'php7.4-ftp'
Note, selecting 'php7.4-common' instead of 'php7.4-gettext'
Note, selecting 'php7.4-common' instead of 'php7.4-iconv'
Note, selecting 'php7.4-common' instead of 'php7.4-pdo'
Note, selecting 'php7.4-common' instead of 'php7.4-phar'
Note, selecting 'php7.4-common' instead of 'php7.4-posix'
Note, selecting 'php7.4-common' instead of 'php7.4-shmop'
Note, selecting 'php7.4-common' instead of 'php7.4-sockets'
Note, selecting 'php7.4-common' instead of 'php7.4-sysvmsg'
Note, selecting 'php7.4-common' instead of 'php7.4-sysvsem'
Note, selecting 'php7.4-common' instead of 'php7.4-sysvshm'
Note, selecting 'php7.4-common' instead of 'php7.4-tokenizer'
Note, selecting 'php7.4-mysql' instead of 'php7.4-mysqli'
Note, selecting 'php7.4-mysql' instead of 'php7.4-mysqlnd'
Note, selecting 'php7.4-mysql' instead of 'php7.4-pdo-mysql'
Note, selecting 'php7.4-odbc' instead of 'php7.4-pdo-odbc'
Note, selecting 'php7.4-pgsql' instead of 'php7.4-pdo-pgsql'
Note, selecting 'php7.4-sqlite3' instead of 'php7.4-pdo-sqlite'
Note, selecting 'php7.4-xml' instead of 'php7.4-dom'
Note, selecting 'php7.4-xml' instead of 'php7.4-simplexml'
Note, selecting 'php7.4-xml' instead of 'php7.4-xmlreader'
Note, selecting 'php7.4-xml' instead of 'php7.4-xmlwriter'
Note, selecting 'php-amqp' instead of 'php7.4-amqp'
Note, selecting 'php-apcu' instead of 'php7.4-apcu'
Note, selecting 'php-apcu-bc' instead of 'php7.4-apcu-bc'
Note, selecting 'php-ds' instead of 'php7.4-ds'
Note, selecting 'php-gearman' instead of 'php7.4-gearman'
Note, selecting 'php-geoip' instead of 'php7.4-geoip'
Note, selecting 'php-gmagick' instead of 'php7.4-gmagick'
Note, selecting 'php-gnupg' instead of 'php7.4-gnupg'
Note, selecting 'php-http' instead of 'php7.4-http'
Note, selecting 'php-igbinary' instead of 'php7.4-igbinary'
Note, selecting 'php-imagick' instead of 'php7.4-imagick'
Note, selecting 'php-lua' instead of 'php7.4-lua'
Note, selecting 'php-mailparse' instead of 'php7.4-mailparse'
Note, selecting 'php-memcache' instead of 'php7.4-memcache'
Note, selecting 'php-memcached' instead of 'php7.4-memcached'
Note, selecting 'php-mongodb' instead of 'php7.4-mongodb'
Note, selecting 'php-msgpack' instead of 'php7.4-msgpack'
Note, selecting 'php-oauth' instead of 'php7.4-oauth'
Note, selecting 'php-pcov' instead of 'php7.4-pcov'
Note, selecting 'php-pinba' instead of 'php7.4-pinba'
Note, selecting 'php-propro' instead of 'php7.4-propro'
Note, selecting 'php-ps' instead of 'php7.4-ps'
Note, selecting 'php-psr' instead of 'php7.4-psr'
Note, selecting 'php-radius' instead of 'php7.4-radius'
Note, selecting 'php-raphf' instead of 'php7.4-raphf'
Note, selecting 'php-redis' instead of 'php7.4-redis'
Note, selecting 'php-rrd' instead of 'php7.4-rrd'
Note, selecting 'php-sass' instead of 'php7.4-sass'
Note, selecting 'php-solr' instead of 'php7.4-solr'
Note, selecting 'php-ssh2' instead of 'php7.4-ssh2'
Note, selecting 'php-stomp' instead of 'php7.4-stomp'
Package 'php7.0-thrift' is not installed, so not removed
Package 'php7.2-thrift' is not installed, so not removed
Note, selecting 'php-tideways' instead of 'php7.4-tideways'
Note, selecting 'php-uploadprogress' instead of 'php7.4-uploadprogress'
Note, selecting 'php-uuid' instead of 'php7.4-uuid'
Note, selecting 'php-xdebug' instead of 'php7.4-xdebug'
Note, selecting 'php-yac' instead of 'php7.4-yac'
Note, selecting 'php-yaml' instead of 'php7.4-yaml'
Note, selecting 'php-zmq' instead of 'php7.4-zmq'
Note, selecting 'php7.4-interbase' instead of 'php7.4-pdo-firebird'
Note, selecting 'php7.4-sybase' instead of 'php7.4-pdo-dblib'
Package 'php7.4' is not installed, so not removed
Package 'php7.4-cgi' is not installed, so not removed
Package 'php7.4-dev' is not installed, so not removed
Package 'php7.4-gd' is not installed, so not removed
Package 'php7.4-gmp' is not installed, so not removed
Package 'php7.4-ldap' is not installed, so not removed
Package 'php7.4-mysql' is not installed, so not removed
Package 'php7.4-odbc' is not installed, so not removed
Package 'php7.4-pgsql' is not installed, so not removed
Package 'php7.4-pspell' is not installed, so not removed
Package 'php7.4-snmp' is not installed, so not removed
Package 'php7.4-sqlite3' is not installed, so not removed
Package 'php7.4-tidy' is not installed, so not removed
Package 'php7.4-xml' is not installed, so not removed
Package 'php7.4-xmlrpc' is not installed, so not removed
Package 'php7.4-bcmath' is not installed, so not removed
Package 'php7.4-bz2' is not installed, so not removed
Package 'php7.4-dba' is not installed, so not removed
Package 'php7.4-enchant' is not installed, so not removed
Package 'php7.4-fpm' is not installed, so not removed
Package 'php7.4-imap' is not installed, so not removed
Package 'php7.4-interbase' is not installed, so not removed
Package 'php7.4-intl' is not installed, so not removed
Package 'php7.4-phpdbg' is not installed, so not removed
Package 'php7.4-soap' is not installed, so not removed
Package 'php7.4-sybase' is not installed, so not removed
Package 'php7.4-xsl' is not installed, so not removed
Package 'php7.4-zip' is not installed, so not removed
The following packages will be REMOVED:
  php7.4-cli* php7.4-common* php7.4-curl* php7.4-json* php7.4-mbstring* php7.4-opcache* php7.4-readline*
0 upgraded, 0 newly installed, 7 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 65835 files and directories currently installed.)
Purging configuration files for php7.4-json (7.4.3-4ubuntu2.18) ...
Purging configuration files for php7.4-common (7.4.3-4ubuntu2.18) ...
dpkg: warning: while removing php7.4-common, directory '/etc/php/7.4/mods-available' not empty so not removed
Purging configuration files for php7.4-curl (7.4.3-4ubuntu2.18) ...
Purging configuration files for php7.4-readline (7.4.3-4ubuntu2.18) ...
Purging configuration files for php7.4-mbstring (7.4.3-4ubuntu2.18) ...
Purging configuration files for php7.4-cli (7.4.3-4ubuntu2.18) ...
Purging configuration files for php7.4-opcache (7.4.3-4ubuntu2.18) ...
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo dpkg -l | grep PHP
rc  php-common                     2:75                                     all          Common files for PHP packages


3、参考:How to Install and Run PHP 8.x on Ubuntu 20.04。添加 PHP PPA 存储库。 使用以下命令安装 PHP 8.1。
<pre class="wp-block-syntaxhighlighter-code">

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
software-properties-common is already the newest version (0.99.9.11).
software-properties-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo add-apt-repository ppa:ondrej/php
 Co-installable PHP versions: PHP 5.6, PHP 7.x, PHP 8.x and most requested extensions are included. Only Supported Versions of PHP (http://php.net/supported-versions.php) for Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided. Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provided.

Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa

You can get more information about the packages at https://deb.sury.org

IMPORTANT: The <foo>-backports is now required on older Ubuntu releases.

BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting

CAVEATS:
1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advised to add ppa:ondrej/nginx-mainline
   or ppa:ondrej/nginx

PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/

WARNING: add-apt-repository is broken with non-UTF-8 locales, see
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:

# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
 More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 https://deb.nodesource.com/node_18.x focal InRelease
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease [23.9 kB]
Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 Packages [115 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2229 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:9 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [358 kB]
Get:10 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main Translation-en [37.5 kB]
Fetched 3100 kB in 10s (301 kB/s)
Reading package lists... Done
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt update
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Hit:4 https://deb.nodesource.com/node_18.x focal InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$

</pre>
4、安装 PHP 8.1 成功。如图1
安装 PHP 8.1 成功

图1



wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ sudo apt install php8.1
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app/learn-php-app-ubuntu-2004-0602/web$ php -v
PHP 8.1.18 (cli) (built: Apr 14 2023 04:39:24) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies


]]>
https://www.shuijingwanwq.com/2023/06/30/7789/feed/ 2
在 WSL2 中的 Ubuntu-20.04 中安装 Shopify CLI 3.0(基于 Node.js),提前检查相应的要求是否满足 https://www.shuijingwanwq.com/2023/06/27/7783/ https://www.shuijingwanwq.com/2023/06/27/7783/#comments Tue, 27 Jun 2023 01:51:43 +0000 https://www.shuijingwanwq.com/?p=7783 浏览量: 242 1、参考:在 Windows 10 专业版中安装 Shopify CLI 3.0(基于 Node.js),提前检查相应的要求是否满足 。 2、参考:在 Linux 中的要求如下


Node.js 16 or higher
Ruby 3.0
Ruby development environment (ruby-dev / ruby-devel)
Git
cURL
GCC
g++
Make


3、Node.js 未安装,参考:安装 。安装失败。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ node -v

Command 'node' not found, but can be installed with:

sudo apt install nodejs

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libc-ares2 libnode64 nodejs-doc
Suggested packages:
npm
The following NEW packages will be installed:
libc-ares2 libnode64 nodejs nodejs-doc
0 upgraded, 4 newly installed, 0 to remove and 93 not upgraded.
Need to get 38.2 kB/6807 kB of archives.
After this operation, 30.7 MB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc-ares2 amd64 1.15.0-1ubuntu0.1
Err:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libc-ares2 amd64 1.15.0-1ubuntu0.1
404 Not Found [IP: 185.125.190.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/c/c-ares/libc-ares2_1.15.0-1ubuntu0.1_amd64.deb 404 Not Found [IP: 185.125.190.39 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


4、执行命令:sudo apt-get update


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2192 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2573 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [435 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.6 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [1882 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [354 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [264 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [636 B]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1064 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [13.0 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [253 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1770 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [24.3 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [25.2 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [7408 B]
Get:20 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [612 B]
Get:21 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [249 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [45.7 kB]
Get:23 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [640 B]
Get:24 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [839 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal-backports/main Translation-en [16.3 kB]
Get:26 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [173 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [1420 B]
Get:28 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [17.8 kB]
Get:29 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [25.0 kB]
Get:30 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [22.9 kB]
Get:31 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [16.3 kB]
Get:32 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5488 B]
Get:33 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B]
Get:34 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [540 B]
Fetched 12.6 MB in 21s (595 kB/s)
Reading package lists... Done


5、再次执行命令: sudo apt-get install -y nodejs,安装 成功。Node.js 的版本是:v10.19.0,低于 16。不符合要求。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libc-ares2 libnode64 nodejs-doc
Suggested packages:
npm
The following NEW packages will be installed:
libc-ares2 libnode64 nodejs nodejs-doc
0 upgraded, 4 newly installed, 0 to remove and 248 not upgraded.
Need to get 36.7 kB/6805 kB of archives.
After this operation, 30.7 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc-ares2 amd64 1.15.0-1ubuntu0.2 [36.7 kB]
Fetched 36.7 kB in 2s (21.7 kB/s)
Selecting previously unselected package libc-ares2:amd64.
(Reading database ... 32378 files and directories currently installed.)
Preparing to unpack .../libc-ares2_1.15.0-1ubuntu0.2_amd64.deb ...
Unpacking libc-ares2:amd64 (1.15.0-1ubuntu0.2) ...
Selecting previously unselected package libnode64:amd64.
Preparing to unpack .../libnode64_10.19.0~dfsg-3ubuntu1_amd64.deb ...
Unpacking libnode64:amd64 (10.19.0~dfsg-3ubuntu1) ...
Selecting previously unselected package nodejs-doc.
Preparing to unpack .../nodejs-doc_10.19.0~dfsg-3ubuntu1_all.deb ...
Unpacking nodejs-doc (10.19.0~dfsg-3ubuntu1) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../nodejs_10.19.0~dfsg-3ubuntu1_amd64.deb ...
Unpacking nodejs (10.19.0~dfsg-3ubuntu1) ...
Setting up libc-ares2:amd64 (1.15.0-1ubuntu0.2) ...
Setting up libnode64:amd64 (10.19.0~dfsg-3ubuntu1) ...
Setting up nodejs-doc (10.19.0~dfsg-3ubuntu1) ...
Setting up nodejs (10.19.0~dfsg-3ubuntu1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ node -v
v10.19.0
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$


6、参考:更新至 Node.js v18.x。Node.js 的版本是:v18.16.0,高于 16。符合要求。如图1
更新至 Node.js v18.x。Node.js 的版本是:v18.16.0,高于 16。符合要求

图1



wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &amp;&amp;\
&gt; sudo apt-get install -y nodejs

## Installing the NodeSource Node.js 18.x repo...

## Populating apt-get cache...

+ apt-get update
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done

## Confirming "focal" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_18.x/dists/focal/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg &gt;/dev/null

## Creating apt sources list file for the NodeSource Node.js 18.x repo...

+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x focal main' &gt; /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x focal main' &gt;&gt; /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Get:5 https://deb.nodesource.com/node_18.x focal InRelease [4583 B]
Get:6 https://deb.nodesource.com/node_18.x focal/main amd64 Packages [776 B]
Fetched 5359 B in 4s (1459 B/s)
Reading package lists... Done

## Run `sudo apt-get install -y nodejs` to install Node.js 18.x and npm
## You may also need development tools to build native addons:
sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg &gt;/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update &amp;&amp; sudo apt-get install yarn

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libc-ares2
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
libnode64 nodejs-doc
The following packages will be upgraded:
nodejs
1 upgraded, 0 newly installed, 2 to remove and 248 not upgraded.
Need to get 28.7 MB of archives.
After this operation, 156 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_18.x focal/main amd64 nodejs amd64 18.16.0-deb-1nodesource1 [28.7 MB]
Fetched 28.7 MB in 8s (3816 kB/s)
(Reading database ... 32510 files and directories currently installed.)
Removing nodejs-doc (10.19.0~dfsg-3ubuntu1) ...
dpkg: libnode64:amd64: dependency problems, but removing anyway as you requested:
nodejs depends on libnode64 (= 10.19.0~dfsg-3ubuntu1).

Removing libnode64:amd64 (10.19.0~dfsg-3ubuntu1) ...
(Reading database ... 32393 files and directories currently installed.)
Preparing to unpack .../nodejs_18.16.0-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (18.16.0-deb-1nodesource1) over (10.19.0~dfsg-3ubuntu1) ...
Setting up nodejs (18.16.0-deb-1nodesource1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ node -v
v18.16.0
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$


7、Ruby 未安装,安装后的版本是:ruby 2.7.0p0,低于 3.0,不符合要求。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo apt-get install ruby-full
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libc-ares2
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
fonts-lato javascript-common libgmp-dev libgmp10 libgmpxx4ldbl libjs-jquery libruby2.7 rake ri ruby ruby-dev
ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby-xmlrpc ruby2.7 ruby2.7-dev ruby2.7-doc
rubygems-integration unzip zip
Suggested packages:
apache2 | lighttpd | httpd gmp-doc libgmp10-doc libmpfr-dev bundler
The following NEW packages will be installed:
fonts-lato javascript-common libgmp-dev libgmpxx4ldbl libjs-jquery libruby2.7 rake ri ruby ruby-dev ruby-full
ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby-xmlrpc ruby2.7 ruby2.7-dev ruby2.7-doc
rubygems-integration unzip zip
The following packages will be upgraded:
libgmp10
1 upgraded, 22 newly installed, 0 to remove and 247 not upgraded.
Need to get 10.2 MB of archives.
After this operation, 58.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 fonts-lato all 2.0-2 [2698 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgmp10 amd64 2:6.2.0+dfsg-4ubuntu0.1 [241 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/main amd64 javascript-common all 11 [6066 B]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgmpxx4ldbl amd64 2:6.2.0+dfsg-4ubuntu0.1 [9144 B]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgmp-dev amd64 2:6.2.0+dfsg-4ubuntu0.1 [320 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 libjs-jquery all 3.3.1~dfsg-3 [329 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 rubygems-integration all 1.16 [5092 B]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ruby2.7 amd64 2.7.0-5ubuntu1.11 [95.6 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby amd64 1:2.7+1 [5412 B]
Get:10 http://archive.ubuntu.com/ubuntu focal/main amd64 rake all 13.0.1-4 [61.6 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-minitest all 5.13.0-1 [40.9 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-net-telnet all 0.1.1-2 [12.6 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-power-assert all 1.1.7-1 [11.4 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-test-unit all 3.3.5-1 [73.2 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-xmlrpc all 0.3.0-2 [23.8 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libruby2.7 amd64 2.7.0-5ubuntu1.11 [3533 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ruby2.7-doc all 2.7.0-5ubuntu1.11 [2160 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal/universe amd64 ri all 1:2.7+1 [4520 B]
Get:19 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ruby2.7-dev amd64 2.7.0-5ubuntu1.11 [182 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal/main amd64 ruby-dev amd64 1:2.7+1 [4632 B]
Get:21 http://archive.ubuntu.com/ubuntu focal/universe amd64 ruby-full all 1:2.7+1 [2728 B]
Get:22 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 unzip amd64 6.0-25ubuntu1.1 [168 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal/main amd64 zip amd64 3.0-11build1 [167 kB]
Fetched 10.2 MB in 16s (643 kB/s)
Selecting previously unselected package fonts-lato.
(Reading database ... 37931 files and directories currently installed.)
Preparing to unpack .../fonts-lato_2.0-2_all.deb ...
Unpacking fonts-lato (2.0-2) ...
Preparing to unpack .../libgmp10_2%3a6.2.0+dfsg-4ubuntu0.1_amd64.deb ...
Unpacking libgmp10:amd64 (2:6.2.0+dfsg-4ubuntu0.1) over (2:6.2.0+dfsg-4) ...
Setting up libgmp10:amd64 (2:6.2.0+dfsg-4ubuntu0.1) ...
Selecting previously unselected package javascript-common.
(Reading database ... 37954 files and directories currently installed.)
Preparing to unpack .../00-javascript-common_11_all.deb ...
Unpacking javascript-common (11) ...
Selecting previously unselected package libgmpxx4ldbl:amd64.
Preparing to unpack .../01-libgmpxx4ldbl_2%3a6.2.0+dfsg-4ubuntu0.1_amd64.deb ...
Unpacking libgmpxx4ldbl:amd64 (2:6.2.0+dfsg-4ubuntu0.1) ...
Selecting previously unselected package libgmp-dev:amd64.
Preparing to unpack .../02-libgmp-dev_2%3a6.2.0+dfsg-4ubuntu0.1_amd64.deb ...
Unpacking libgmp-dev:amd64 (2:6.2.0+dfsg-4ubuntu0.1) ...
Selecting previously unselected package libjs-jquery.
Preparing to unpack .../03-libjs-jquery_3.3.1~dfsg-3_all.deb ...
Unpacking libjs-jquery (3.3.1~dfsg-3) ...
Selecting previously unselected package rubygems-integration.
Preparing to unpack .../04-rubygems-integration_1.16_all.deb ...
Unpacking rubygems-integration (1.16) ...
Selecting previously unselected package ruby2.7.
Preparing to unpack .../05-ruby2.7_2.7.0-5ubuntu1.11_amd64.deb ...
Unpacking ruby2.7 (2.7.0-5ubuntu1.11) ...
Selecting previously unselected package ruby.
Preparing to unpack .../06-ruby_1%3a2.7+1_amd64.deb ...
Unpacking ruby (1:2.7+1) ...
Selecting previously unselected package rake.
Preparing to unpack .../07-rake_13.0.1-4_all.deb ...
Unpacking rake (13.0.1-4) ...
Selecting previously unselected package ruby-minitest.
Preparing to unpack .../08-ruby-minitest_5.13.0-1_all.deb ...
Unpacking ruby-minitest (5.13.0-1) ...
Selecting previously unselected package ruby-net-telnet.
Preparing to unpack .../09-ruby-net-telnet_0.1.1-2_all.deb ...
Unpacking ruby-net-telnet (0.1.1-2) ...
Selecting previously unselected package ruby-power-assert.
Preparing to unpack .../10-ruby-power-assert_1.1.7-1_all.deb ...
Unpacking ruby-power-assert (1.1.7-1) ...
Selecting previously unselected package ruby-test-unit.
Preparing to unpack .../11-ruby-test-unit_3.3.5-1_all.deb ...
Unpacking ruby-test-unit (3.3.5-1) ...
Selecting previously unselected package ruby-xmlrpc.
Preparing to unpack .../12-ruby-xmlrpc_0.3.0-2_all.deb ...
Unpacking ruby-xmlrpc (0.3.0-2) ...
Selecting previously unselected package libruby2.7:amd64.
Preparing to unpack .../13-libruby2.7_2.7.0-5ubuntu1.11_amd64.deb ...
Unpacking libruby2.7:amd64 (2.7.0-5ubuntu1.11) ...
Selecting previously unselected package ruby2.7-doc.
Preparing to unpack .../14-ruby2.7-doc_2.7.0-5ubuntu1.11_all.deb ...
Unpacking ruby2.7-doc (2.7.0-5ubuntu1.11) ...
Selecting previously unselected package ri.
Preparing to unpack .../15-ri_1%3a2.7+1_all.deb ...
Unpacking ri (1:2.7+1) ...
Selecting previously unselected package ruby2.7-dev:amd64.
Preparing to unpack .../16-ruby2.7-dev_2.7.0-5ubuntu1.11_amd64.deb ...
Unpacking ruby2.7-dev:amd64 (2.7.0-5ubuntu1.11) ...
Selecting previously unselected package ruby-dev:amd64.
Preparing to unpack .../17-ruby-dev_1%3a2.7+1_amd64.deb ...
Unpacking ruby-dev:amd64 (1:2.7+1) ...
Selecting previously unselected package ruby-full.
Preparing to unpack .../18-ruby-full_1%3a2.7+1_all.deb ...
Unpacking ruby-full (1:2.7+1) ...
Selecting previously unselected package unzip.
Preparing to unpack .../19-unzip_6.0-25ubuntu1.1_amd64.deb ...
Unpacking unzip (6.0-25ubuntu1.1) ...
Selecting previously unselected package zip.
Preparing to unpack .../20-zip_3.0-11build1_amd64.deb ...
Unpacking zip (3.0-11build1) ...
Setting up javascript-common (11) ...
Setting up fonts-lato (2.0-2) ...
Setting up ruby-power-assert (1.1.7-1) ...
Setting up unzip (6.0-25ubuntu1.1) ...
Setting up rubygems-integration (1.16) ...
Setting up ruby-minitest (5.13.0-1) ...
Setting up zip (3.0-11build1) ...
Setting up libgmpxx4ldbl:amd64 (2:6.2.0+dfsg-4ubuntu0.1) ...
Setting up ruby-test-unit (3.3.5-1) ...
Setting up ruby-net-telnet (0.1.1-2) ...
Setting up ruby2.7-doc (2.7.0-5ubuntu1.11) ...
Setting up libjs-jquery (3.3.1~dfsg-3) ...
Setting up ruby-xmlrpc (0.3.0-2) ...
Setting up libgmp-dev:amd64 (2:6.2.0+dfsg-4ubuntu0.1) ...
Setting up ruby2.7 (2.7.0-5ubuntu1.11) ...
Setting up ri (1:2.7+1) ...
Setting up ruby (1:2.7+1) ...
Setting up rake (13.0.1-4) ...
Setting up libruby2.7:amd64 (2.7.0-5ubuntu1.11) ...
Setting up ruby2.7-dev:amd64 (2.7.0-5ubuntu1.11) ...
Setting up ruby-dev:amd64 (1:2.7+1) ...
Setting up ruby-full (1:2.7+1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$


8、包管理器中的 Ruby 版本通常都不是最新的。决定基于安装工具 ruby-build 安装 3.0 版本。ruby-build 会尽力下载并编译想要的 Ruby 版本,但有时会因为未满足系统依赖而导致编译失败,或者编译成功但新的 Ruby 版本在运行时出现奇怪的错误。 准备对合理构建环境的建议。参考:构建 。然后再安装 ruby-build。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo apt-get install autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev
[sudo] password for wangqiang:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libreadline-dev' instead of 'libreadline6-dev'
libgdbm6 is already the newest version (1.18.1-5).
libgdbm6 set to manually installed.
patch is already the newest version (2.7.6-6).
patch set to manually installed.
libgmp-dev is already the newest version (2:6.2.0+dfsg-4ubuntu0.1).
libgmp-dev set to manually installed.
The following package was automatically installed and is no longer required:
libc-ares2
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-9 dpkg-dev fakeroot g++ g++-9 gcc
gcc-9 gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1
libbinutils libc-dev-bin libc6 libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdb5.3-dev libdpkg-perl
libfakeroot libfile-fcntllock-perl libgcc-9-dev libgomp1 libisl22 libitm1 liblsan0 libmpc3 libncurses-dev
libncurses6 libncursesw6 libquadmath0 libssl1.1 libstd-rust-1.65 libstd-rust-dev libstdc++-9-dev libtinfo6 libtsan0
libubsan1 libuuid1 linux-libc-dev m4 manpages-dev zlib1g
Suggested packages:
autoconf-archive gnu-standards autoconf-doc libtool gettext binutils-doc cpp-doc gcc-9-locales debian-keyring
g++-multilib g++-9-multilib gcc-9-doc gcc-multilib flex bison gdb gcc-doc gcc-9-multilib glibc-doc db5.3-doc bzr
ncurses-doc readline-doc libssl-doc libstdc++-9-doc libyaml-doc m4-doc cargo llvm-14 lld-14 clang-14
The following NEW packages will be installed:
autoconf automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-9
dpkg-dev fakeroot g++ g++-9 gcc gcc-9 gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl
libalgorithm-merge-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0
libctf0 libdb-dev libdb5.3-dev libdpkg-perl libfakeroot libffi-dev libfile-fcntllock-perl libgcc-9-dev libgdbm-dev
libgomp1 libisl22 libitm1 liblsan0 libmpc3 libncurses-dev libncurses5-dev libquadmath0 libreadline-dev libssl-dev
libstd-rust-1.65 libstd-rust-dev libstdc++-9-dev libtsan0 libubsan1 libyaml-dev linux-libc-dev m4 manpages-dev rustc
uuid-dev zlib1g-dev
The following packages will be upgraded:
libc6 libncurses6 libncursesw6 libssl1.1 libtinfo6 libuuid1 zlib1g
7 upgraded, 58 newly installed, 0 to remove and 240 not upgraded.
Need to get 136 MB of archives.
After this operation, 593 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6 amd64 2.31-0ubuntu9.9 [2722 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libncursesw6 amd64 6.2-0ubuntu2.1 [132 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libncurses6 amd64 6.2-0ubuntu2.1 [101 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libtinfo6 amd64 6.2-0ubuntu2.1 [87.4 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libuuid1 amd64 2.34-0.1ubuntu9.3 [19.9 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 zlib1g amd64 1:1.2.11.dfsg-2ubuntu1.5 [54.2 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.18 [1322 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/main amd64 m4 amd64 1.4.18-4 [199 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal/main amd64 autoconf all 2.69-11.1 [321 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/main amd64 autotools-dev all 20180224.1 [39.6 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 automake all 1:1.16.1-4ubuntu6 [522 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 binutils-common amd64 2.34-6ubuntu1.5 [207 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libbinutils amd64 2.34-6ubuntu1.5 [475 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libctf-nobfd0 amd64 2.34-6ubuntu1.5 [47.4 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libctf0 amd64 2.34-6ubuntu1.5 [46.6 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 binutils-x86-64-linux-gnu amd64 2.34-6ubuntu1.5 [1613 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 binutils amd64 2.34-6ubuntu1.5 [3372 B]
Get:18 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc-dev-bin amd64 2.31-0ubuntu9.9 [71.8 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-libc-dev amd64 5.4.0-149.166 [1117 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal/main amd64 libcrypt-dev amd64 1:4.4.10-10ubuntu4 [104 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libc6-dev amd64 2.31-0ubuntu9.9 [2519 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gcc-9-base amd64 9.4.0-1ubuntu1~20.04.1 [19.4 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal/main amd64 libisl22 amd64 0.22.1-1 [592 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal/main amd64 libmpc3 amd64 1.1.0-1 [40.8 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 cpp-9 amd64 9.4.0-1ubuntu1~20.04.1 [7500 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal/main amd64 cpp amd64 4:9.3.0-1ubuntu2 [27.6 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcc1-0 amd64 10.3.0-1ubuntu1~20.04 [48.8 kB]
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgomp1 amd64 10.3.0-1ubuntu1~20.04 [102 kB]
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libitm1 amd64 10.3.0-1ubuntu1~20.04 [26.2 kB]
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libatomic1 amd64 10.3.0-1ubuntu1~20.04 [9284 B]
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libasan5 amd64 9.4.0-1ubuntu1~20.04.1 [2751 kB]
Get:32 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 liblsan0 amd64 10.3.0-1ubuntu1~20.04 [835 kB]
Get:33 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libtsan0 amd64 10.3.0-1ubuntu1~20.04 [2009 kB]
Get:34 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libubsan1 amd64 10.3.0-1ubuntu1~20.04 [784 kB]
Get:35 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libquadmath0 amd64 10.3.0-1ubuntu1~20.04 [146 kB]
Get:36 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgcc-9-dev amd64 9.4.0-1ubuntu1~20.04.1 [2359 kB]
Get:37 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gcc-9 amd64 9.4.0-1ubuntu1~20.04.1 [8274 kB]
Get:38 http://archive.ubuntu.com/ubuntu focal/main amd64 gcc amd64 4:9.3.0-1ubuntu2 [5208 B]
Get:39 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libstdc++-9-dev amd64 9.4.0-1ubuntu1~20.04.1 [1722 kB]
Get:40 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 g++-9 amd64 9.4.0-1ubuntu1~20.04.1 [8420 kB]
Get:41 http://archive.ubuntu.com/ubuntu focal/main amd64 g++ amd64 4:9.3.0-1ubuntu2 [1604 B]
Get:42 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libdpkg-perl all 1.19.7ubuntu3.2 [231 kB]
Get:43 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 dpkg-dev all 1.19.7ubuntu3.2 [679 kB]
Get:44 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 build-essential amd64 12.8ubuntu1.1 [4664 B]
Get:45 http://archive.ubuntu.com/ubuntu focal/main amd64 libfakeroot amd64 1.24-1 [25.7 kB]
Get:46 http://archive.ubuntu.com/ubuntu focal/main amd64 fakeroot amd64 1.24-1 [62.6 kB]
Get:47 http://archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-diff-perl all 1.19.03-2 [46.6 kB]
Get:48 http://archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-diff-xs-perl amd64 0.04-6 [11.3 kB]
Get:49 http://archive.ubuntu.com/ubuntu focal/main amd64 libalgorithm-merge-perl all 0.08-3 [12.0 kB]
Get:50 http://archive.ubuntu.com/ubuntu focal/main amd64 libfile-fcntllock-perl amd64 0.22-3build4 [33.1 kB]
Get:51 http://archive.ubuntu.com/ubuntu focal/main amd64 libgdbm-dev amd64 1.18.1-5 [83.4 kB]
Get:52 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libncurses-dev amd64 6.2-0ubuntu2.1 [340 kB]
Get:53 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libncurses5-dev amd64 6.2-0ubuntu2.1 [984 B]
Get:54 http://archive.ubuntu.com/ubuntu focal/main amd64 libreadline-dev amd64 8.0-4 [141 kB]
Get:55 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl-dev amd64 1.1.1f-1ubuntu2.18 [1586 kB]
Get:56 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libstd-rust-1.65 amd64 1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04 [41.8 MB]
Get:57 http://archive.ubuntu.com/ubuntu focal/main amd64 manpages-dev all 5.05-1 [2266 kB]
Get:58 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 zlib1g-dev amd64 1:1.2.11.dfsg-2ubuntu1.5 [155 kB]
Get:59 http://archive.ubuntu.com/ubuntu focal/main amd64 libdb5.3-dev amd64 5.3.28+dfsg1-0.6ubuntu2 [766 kB]
Get:60 http://archive.ubuntu.com/ubuntu focal/main amd64 libdb-dev amd64 1:5.3.21~exp1ubuntu2 [2294 B]
Get:61 http://archive.ubuntu.com/ubuntu focal/main amd64 libffi-dev amd64 3.3-4 [57.0 kB]
Get:62 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libstd-rust-dev amd64 1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04 [36.8 MB]
Get:63 http://archive.ubuntu.com/ubuntu focal/main amd64 libyaml-dev amd64 0.2.2-1 [58.2 kB]
Get:64 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 rustc amd64 1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04 [2967 kB]
Get:65 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 uuid-dev amd64 2.34-0.1ubuntu9.3 [33.6 kB]
Fetched 136 MB in 2min 1s (1124 kB/s)
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 58487 files and directories currently installed.)
Preparing to unpack .../libc6_2.31-0ubuntu9.9_amd64.deb ...
Unpacking libc6:amd64 (2.31-0ubuntu9.9) over (2.31-0ubuntu9.2) ...
Setting up libc6:amd64 (2.31-0ubuntu9.9) ...
(Reading database ... 58487 files and directories currently installed.)
Preparing to unpack .../libncursesw6_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncursesw6:amd64 (6.2-0ubuntu2.1) over (6.2-0ubuntu2) ...
Preparing to unpack .../libncurses6_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncurses6:amd64 (6.2-0ubuntu2.1) over (6.2-0ubuntu2) ...
Preparing to unpack .../libtinfo6_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libtinfo6:amd64 (6.2-0ubuntu2.1) over (6.2-0ubuntu2) ...
Setting up libtinfo6:amd64 (6.2-0ubuntu2.1) ...
(Reading database ... 58487 files and directories currently installed.)
Preparing to unpack .../libuuid1_2.34-0.1ubuntu9.3_amd64.deb ...
Unpacking libuuid1:amd64 (2.34-0.1ubuntu9.3) over (2.34-0.1ubuntu9.1) ...
Setting up libuuid1:amd64 (2.34-0.1ubuntu9.3) ...
(Reading database ... 58487 files and directories currently installed.)
Preparing to unpack .../zlib1g_1%3a1.2.11.dfsg-2ubuntu1.5_amd64.deb ...
Unpacking zlib1g:amd64 (1:1.2.11.dfsg-2ubuntu1.5) over (1:1.2.11.dfsg-2ubuntu1.2) ...
Setting up zlib1g:amd64 (1:1.2.11.dfsg-2ubuntu1.5) ...
(Reading database ... 58487 files and directories currently installed.)
Preparing to unpack .../00-libssl1.1_1.1.1f-1ubuntu2.18_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.18) over (1.1.1f-1ubuntu2.5) ...
Selecting previously unselected package m4.
Preparing to unpack .../01-m4_1.4.18-4_amd64.deb ...
Unpacking m4 (1.4.18-4) ...
Selecting previously unselected package autoconf.
Preparing to unpack .../02-autoconf_2.69-11.1_all.deb ...
Unpacking autoconf (2.69-11.1) ...
Selecting previously unselected package autotools-dev.
Preparing to unpack .../03-autotools-dev_20180224.1_all.deb ...
Unpacking autotools-dev (20180224.1) ...
Selecting previously unselected package automake.
Preparing to unpack .../04-automake_1%3a1.16.1-4ubuntu6_all.deb ...
Unpacking automake (1:1.16.1-4ubuntu6) ...
Selecting previously unselected package binutils-common:amd64.
Preparing to unpack .../05-binutils-common_2.34-6ubuntu1.5_amd64.deb ...
Unpacking binutils-common:amd64 (2.34-6ubuntu1.5) ...
Selecting previously unselected package libbinutils:amd64.
Preparing to unpack .../06-libbinutils_2.34-6ubuntu1.5_amd64.deb ...
Unpacking libbinutils:amd64 (2.34-6ubuntu1.5) ...
Selecting previously unselected package libctf-nobfd0:amd64.
Preparing to unpack .../07-libctf-nobfd0_2.34-6ubuntu1.5_amd64.deb ...
Unpacking libctf-nobfd0:amd64 (2.34-6ubuntu1.5) ...
Selecting previously unselected package libctf0:amd64.
Preparing to unpack .../08-libctf0_2.34-6ubuntu1.5_amd64.deb ...
Unpacking libctf0:amd64 (2.34-6ubuntu1.5) ...
Selecting previously unselected package binutils-x86-64-linux-gnu.
Preparing to unpack .../09-binutils-x86-64-linux-gnu_2.34-6ubuntu1.5_amd64.deb ...
Unpacking binutils-x86-64-linux-gnu (2.34-6ubuntu1.5) ...
Selecting previously unselected package binutils.
Preparing to unpack .../10-binutils_2.34-6ubuntu1.5_amd64.deb ...
Unpacking binutils (2.34-6ubuntu1.5) ...
Selecting previously unselected package libc-dev-bin.
Preparing to unpack .../11-libc-dev-bin_2.31-0ubuntu9.9_amd64.deb ...
Unpacking libc-dev-bin (2.31-0ubuntu9.9) ...
Selecting previously unselected package linux-libc-dev:amd64.
Preparing to unpack .../12-linux-libc-dev_5.4.0-149.166_amd64.deb ...
Unpacking linux-libc-dev:amd64 (5.4.0-149.166) ...
Selecting previously unselected package libcrypt-dev:amd64.
Preparing to unpack .../13-libcrypt-dev_1%3a4.4.10-10ubuntu4_amd64.deb ...
Unpacking libcrypt-dev:amd64 (1:4.4.10-10ubuntu4) ...
Selecting previously unselected package libc6-dev:amd64.
Preparing to unpack .../14-libc6-dev_2.31-0ubuntu9.9_amd64.deb ...
Unpacking libc6-dev:amd64 (2.31-0ubuntu9.9) ...
Selecting previously unselected package gcc-9-base:amd64.
Preparing to unpack .../15-gcc-9-base_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking gcc-9-base:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package libisl22:amd64.
Preparing to unpack .../16-libisl22_0.22.1-1_amd64.deb ...
Unpacking libisl22:amd64 (0.22.1-1) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../17-libmpc3_1.1.0-1_amd64.deb ...
Unpacking libmpc3:amd64 (1.1.0-1) ...
Selecting previously unselected package cpp-9.
Preparing to unpack .../18-cpp-9_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking cpp-9 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package cpp.
Preparing to unpack .../19-cpp_4%3a9.3.0-1ubuntu2_amd64.deb ...
Unpacking cpp (4:9.3.0-1ubuntu2) ...
Selecting previously unselected package libcc1-0:amd64.
Preparing to unpack .../20-libcc1-0_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libcc1-0:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libgomp1:amd64.
Preparing to unpack .../21-libgomp1_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libgomp1:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../22-libitm1_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libitm1:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../23-libatomic1_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libatomic1:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libasan5:amd64.
Preparing to unpack .../24-libasan5_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking libasan5:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package liblsan0:amd64.
Preparing to unpack .../25-liblsan0_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking liblsan0:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../26-libtsan0_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libtsan0:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libubsan1:amd64.
Preparing to unpack .../27-libubsan1_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libubsan1:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libquadmath0:amd64.
Preparing to unpack .../28-libquadmath0_10.3.0-1ubuntu1~20.04_amd64.deb ...
Unpacking libquadmath0:amd64 (10.3.0-1ubuntu1~20.04) ...
Selecting previously unselected package libgcc-9-dev:amd64.
Preparing to unpack .../29-libgcc-9-dev_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking libgcc-9-dev:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package gcc-9.
Preparing to unpack .../30-gcc-9_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking gcc-9 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package gcc.
Preparing to unpack .../31-gcc_4%3a9.3.0-1ubuntu2_amd64.deb ...
Unpacking gcc (4:9.3.0-1ubuntu2) ...
Selecting previously unselected package libstdc++-9-dev:amd64.
Preparing to unpack .../32-libstdc++-9-dev_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking libstdc++-9-dev:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package g++-9.
Preparing to unpack .../33-g++-9_9.4.0-1ubuntu1~20.04.1_amd64.deb ...
Unpacking g++-9 (9.4.0-1ubuntu1~20.04.1) ...
Selecting previously unselected package g++.
Preparing to unpack .../34-g++_4%3a9.3.0-1ubuntu2_amd64.deb ...
Unpacking g++ (4:9.3.0-1ubuntu2) ...
Selecting previously unselected package libdpkg-perl.
Preparing to unpack .../35-libdpkg-perl_1.19.7ubuntu3.2_all.deb ...
Unpacking libdpkg-perl (1.19.7ubuntu3.2) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../36-dpkg-dev_1.19.7ubuntu3.2_all.deb ...
Unpacking dpkg-dev (1.19.7ubuntu3.2) ...
Selecting previously unselected package build-essential.
Preparing to unpack .../37-build-essential_12.8ubuntu1.1_amd64.deb ...
Unpacking build-essential (12.8ubuntu1.1) ...
Selecting previously unselected package libfakeroot:amd64.
Preparing to unpack .../38-libfakeroot_1.24-1_amd64.deb ...
Unpacking libfakeroot:amd64 (1.24-1) ...
Selecting previously unselected package fakeroot.
Preparing to unpack .../39-fakeroot_1.24-1_amd64.deb ...
Unpacking fakeroot (1.24-1) ...
Selecting previously unselected package libalgorithm-diff-perl.
Preparing to unpack .../40-libalgorithm-diff-perl_1.19.03-2_all.deb ...
Unpacking libalgorithm-diff-perl (1.19.03-2) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Preparing to unpack .../41-libalgorithm-diff-xs-perl_0.04-6_amd64.deb ...
Unpacking libalgorithm-diff-xs-perl (0.04-6) ...
Selecting previously unselected package libalgorithm-merge-perl.
Preparing to unpack .../42-libalgorithm-merge-perl_0.08-3_all.deb ...
Unpacking libalgorithm-merge-perl (0.08-3) ...
Selecting previously unselected package libfile-fcntllock-perl.
Preparing to unpack .../43-libfile-fcntllock-perl_0.22-3build4_amd64.deb ...
Unpacking libfile-fcntllock-perl (0.22-3build4) ...
Selecting previously unselected package libgdbm-dev:amd64.
Preparing to unpack .../44-libgdbm-dev_1.18.1-5_amd64.deb ...
Unpacking libgdbm-dev:amd64 (1.18.1-5) ...
Selecting previously unselected package libncurses-dev:amd64.
Preparing to unpack .../45-libncurses-dev_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncurses-dev:amd64 (6.2-0ubuntu2.1) ...
Selecting previously unselected package libncurses5-dev:amd64.
Preparing to unpack .../46-libncurses5-dev_6.2-0ubuntu2.1_amd64.deb ...
Unpacking libncurses5-dev:amd64 (6.2-0ubuntu2.1) ...
Selecting previously unselected package libreadline-dev:amd64.
Preparing to unpack .../47-libreadline-dev_8.0-4_amd64.deb ...
Unpacking libreadline-dev:amd64 (8.0-4) ...
Selecting previously unselected package libssl-dev:amd64.
Preparing to unpack .../48-libssl-dev_1.1.1f-1ubuntu2.18_amd64.deb ...
Unpacking libssl-dev:amd64 (1.1.1f-1ubuntu2.18) ...
Selecting previously unselected package libstd-rust-1.65:amd64.
Preparing to unpack .../49-libstd-rust-1.65_1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04_amd64.deb ...
Unpacking libstd-rust-1.65:amd64 (1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../50-manpages-dev_5.05-1_all.deb ...
Unpacking manpages-dev (5.05-1) ...
Selecting previously unselected package zlib1g-dev:amd64.
Preparing to unpack .../51-zlib1g-dev_1%3a1.2.11.dfsg-2ubuntu1.5_amd64.deb ...
Unpacking zlib1g-dev:amd64 (1:1.2.11.dfsg-2ubuntu1.5) ...
Selecting previously unselected package libdb5.3-dev.
Preparing to unpack .../52-libdb5.3-dev_5.3.28+dfsg1-0.6ubuntu2_amd64.deb ...
Unpacking libdb5.3-dev (5.3.28+dfsg1-0.6ubuntu2) ...
Selecting previously unselected package libdb-dev:amd64.
Preparing to unpack .../53-libdb-dev_1%3a5.3.21~exp1ubuntu2_amd64.deb ...
Unpacking libdb-dev:amd64 (1:5.3.21~exp1ubuntu2) ...
Selecting previously unselected package libffi-dev:amd64.
Preparing to unpack .../54-libffi-dev_3.3-4_amd64.deb ...
Unpacking libffi-dev:amd64 (3.3-4) ...
Selecting previously unselected package libstd-rust-dev:amd64.
Preparing to unpack .../55-libstd-rust-dev_1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04_amd64.deb ...
Unpacking libstd-rust-dev:amd64 (1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04) ...
Selecting previously unselected package libyaml-dev:amd64.
Preparing to unpack .../56-libyaml-dev_0.2.2-1_amd64.deb ...
Unpacking libyaml-dev:amd64 (0.2.2-1) ...
Selecting previously unselected package rustc.
Preparing to unpack .../57-rustc_1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04_amd64.deb ...
Unpacking rustc (1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04) ...
Selecting previously unselected package uuid-dev:amd64.
Preparing to unpack .../58-uuid-dev_2.34-0.1ubuntu9.3_amd64.deb ...
Unpacking uuid-dev:amd64 (2.34-0.1ubuntu9.3) ...
Setting up manpages-dev (5.05-1) ...
Setting up libyaml-dev:amd64 (0.2.2-1) ...
Setting up libfile-fcntllock-perl (0.22-3build4) ...
Setting up libalgorithm-diff-perl (1.19.03-2) ...
Setting up libssl1.1:amd64 (1.1.1f-1ubuntu2.18) ...
Setting up binutils-common:amd64 (2.34-6ubuntu1.5) ...
Setting up linux-libc-dev:amd64 (5.4.0-149.166) ...
Setting up libctf-nobfd0:amd64 (2.34-6ubuntu1.5) ...
Setting up m4 (1.4.18-4) ...
Setting up libgomp1:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up libffi-dev:amd64 (3.3-4) ...
Setting up libfakeroot:amd64 (1.24-1) ...
Setting up fakeroot (1.24-1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up autotools-dev (20180224.1) ...
Setting up libncurses6:amd64 (6.2-0ubuntu2.1) ...
Setting up libquadmath0:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up libssl-dev:amd64 (1.1.1f-1ubuntu2.18) ...
Setting up libmpc3:amd64 (1.1.0-1) ...
Setting up libatomic1:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up libncursesw6:amd64 (6.2-0ubuntu2.1) ...
Setting up libdpkg-perl (1.19.7ubuntu3.2) ...
Setting up autoconf (2.69-11.1) ...
Setting up libubsan1:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up libstd-rust-1.65:amd64 (1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04) ...
Setting up libdb5.3-dev (5.3.28+dfsg1-0.6ubuntu2) ...
Setting up libcrypt-dev:amd64 (1:4.4.10-10ubuntu4) ...
Setting up libisl22:amd64 (0.22.1-1) ...
Setting up libbinutils:amd64 (2.34-6ubuntu1.5) ...
Setting up libc-dev-bin (2.31-0ubuntu9.9) ...
Setting up libalgorithm-diff-xs-perl (0.04-6) ...
Setting up libcc1-0:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up liblsan0:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up libitm1:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up gcc-9-base:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
Setting up libtsan0:amd64 (10.3.0-1ubuntu1~20.04) ...
Setting up libctf0:amd64 (2.34-6ubuntu1.5) ...
Setting up automake (1:1.16.1-4ubuntu6) ...
update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode
Setting up libstd-rust-dev:amd64 (1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04) ...
Setting up libasan5:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Setting up libdb-dev:amd64 (1:5.3.21~exp1ubuntu2) ...
Setting up cpp-9 (9.4.0-1ubuntu1~20.04.1) ...
Setting up libc6-dev:amd64 (2.31-0ubuntu9.9) ...
Setting up libgdbm-dev:amd64 (1.18.1-5) ...
Setting up binutils-x86-64-linux-gnu (2.34-6ubuntu1.5) ...
Setting up libncurses-dev:amd64 (6.2-0ubuntu2.1) ...
Setting up binutils (2.34-6ubuntu1.5) ...
Setting up libreadline-dev:amd64 (8.0-4) ...
Setting up dpkg-dev (1.19.7ubuntu3.2) ...
Setting up libgcc-9-dev:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Setting up uuid-dev:amd64 (2.34-0.1ubuntu9.3) ...
Setting up zlib1g-dev:amd64 (1:1.2.11.dfsg-2ubuntu1.5) ...
Setting up cpp (4:9.3.0-1ubuntu2) ...
Setting up libncurses5-dev:amd64 (6.2-0ubuntu2.1) ...
Setting up gcc-9 (9.4.0-1ubuntu1~20.04.1) ...
Setting up libstdc++-9-dev:amd64 (9.4.0-1ubuntu1~20.04.1) ...
Setting up gcc (4:9.3.0-1ubuntu2) ...
Setting up g++-9 (9.4.0-1ubuntu1~20.04.1) ...
Setting up g++ (4:9.3.0-1ubuntu2) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up rustc (1.65.0+dfsg0ubuntu1~llvm2-0ubuntu0.20.04) ...
Setting up build-essential (12.8ubuntu1.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

Processing triggers for man-db (2.9.1-1) ...
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo apt-get install ruby-build
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libc-ares2
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
icu-devtools libicu-dev libicu66 libsqlite3-0 libsqlite3-dev libxml2 libxml2-dev libxslt1-dev libxslt1.1 rbenv
Suggested packages:
icu-doc sqlite3-doc pkg-config bison libtool
The following NEW packages will be installed:
icu-devtools libicu-dev libsqlite3-dev libxml2-dev libxslt1-dev rbenv ruby-build
The following packages will be upgraded:
libicu66 libsqlite3-0 libxml2 libxslt1.1
4 upgraded, 7 newly installed, 0 to remove and 236 not upgraded.
Need to get 21.2 MB of archives.
After this operation, 53.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libicu66 amd64 66.1-2ubuntu2.1 [8515 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libsqlite3-0 amd64 3.31.1-4ubuntu0.5 [549 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libxml2 amd64 2.9.10+dfsg-5ubuntu0.20.04.6 [640 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 icu-devtools amd64 66.1-2ubuntu2.1 [189 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libicu-dev amd64 66.1-2ubuntu2.1 [9451 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libsqlite3-dev amd64 3.31.1-4ubuntu0.5 [697 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libxml2-dev amd64 2.9.10+dfsg-5ubuntu0.20.04.6 [735 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libxslt1.1 amd64 1.1.34-4ubuntu0.20.04.1 [151 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libxslt1-dev amd64 1.1.34-4ubuntu0.20.04.1 [219 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/universe amd64 rbenv all 1.1.1-1 [22.1 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal/universe amd64 ruby-build all 20170726-1 [46.1 kB]
Fetched 21.2 MB in 13s (1669 kB/s)
(Reading database ... 64775 files and directories currently installed.)
Preparing to unpack .../00-libicu66_66.1-2ubuntu2.1_amd64.deb ...
Unpacking libicu66:amd64 (66.1-2ubuntu2.1) over (66.1-2ubuntu2) ...
Preparing to unpack .../01-libsqlite3-0_3.31.1-4ubuntu0.5_amd64.deb ...
Unpacking libsqlite3-0:amd64 (3.31.1-4ubuntu0.5) over (3.31.1-4ubuntu0.2) ...
Preparing to unpack .../02-libxml2_2.9.10+dfsg-5ubuntu0.20.04.6_amd64.deb ...
Unpacking libxml2:amd64 (2.9.10+dfsg-5ubuntu0.20.04.6) over (2.9.10+dfsg-5ubuntu0.20.04.1) ...
Selecting previously unselected package icu-devtools.
Preparing to unpack .../03-icu-devtools_66.1-2ubuntu2.1_amd64.deb ...
Unpacking icu-devtools (66.1-2ubuntu2.1) ...
Selecting previously unselected package libicu-dev:amd64.
Preparing to unpack .../04-libicu-dev_66.1-2ubuntu2.1_amd64.deb ...
Unpacking libicu-dev:amd64 (66.1-2ubuntu2.1) ...
Selecting previously unselected package libsqlite3-dev:amd64.
Preparing to unpack .../05-libsqlite3-dev_3.31.1-4ubuntu0.5_amd64.deb ...
Unpacking libsqlite3-dev:amd64 (3.31.1-4ubuntu0.5) ...
Selecting previously unselected package libxml2-dev:amd64.
Preparing to unpack .../06-libxml2-dev_2.9.10+dfsg-5ubuntu0.20.04.6_amd64.deb ...
Unpacking libxml2-dev:amd64 (2.9.10+dfsg-5ubuntu0.20.04.6) ...
Preparing to unpack .../07-libxslt1.1_1.1.34-4ubuntu0.20.04.1_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.34-4ubuntu0.20.04.1) over (1.1.34-4) ...
Selecting previously unselected package libxslt1-dev:amd64.
Preparing to unpack .../08-libxslt1-dev_1.1.34-4ubuntu0.20.04.1_amd64.deb ...
Unpacking libxslt1-dev:amd64 (1.1.34-4ubuntu0.20.04.1) ...
Selecting previously unselected package rbenv.
Preparing to unpack .../09-rbenv_1.1.1-1_all.deb ...
Unpacking rbenv (1.1.1-1) ...
Selecting previously unselected package ruby-build.
Preparing to unpack .../10-ruby-build_20170726-1_all.deb ...
Unpacking ruby-build (20170726-1) ...
Setting up ruby-build (20170726-1) ...
Setting up libicu66:amd64 (66.1-2ubuntu2.1) ...
Setting up libsqlite3-0:amd64 (3.31.1-4ubuntu0.5) ...
Setting up libsqlite3-dev:amd64 (3.31.1-4ubuntu0.5) ...
Setting up icu-devtools (66.1-2ubuntu2.1) ...
Setting up rbenv (1.1.1-1) ...
Setting up libicu-dev:amd64 (66.1-2ubuntu2.1) ...
Setting up libxml2:amd64 (2.9.10+dfsg-5ubuntu0.20.04.6) ...
Setting up libxml2-dev:amd64 (2.9.10+dfsg-5ubuntu0.20.04.6) ...
Setting up libxslt1.1:amd64 (1.1.34-4ubuntu0.20.04.1) ...
Setting up libxslt1-dev:amd64 (1.1.34-4ubuntu0.20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$


9、作为 rbenv 插件,列出所有可用的 Ruby 版本,执行命令:rbenv install –list ,安装 Ruby rbx-3.82 到 ~/.rbenv/versions,执行命令:rbenv install rbx-3.82。安装失败。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ rbenv install --list
Available versions:
1.8.5-p52
1.8.5-p113
1.8.5-p114
1.8.5-p115
1.8.5-p231
1.8.6
1.8.6-p36
1.8.6-p110
1.8.6-p111
1.8.6-p114
1.8.6-p230
1.8.6-p286
1.8.6-p287
1.8.6-p368
1.8.6-p369
1.8.6-p383
1.8.6-p388
1.8.6-p398
1.8.6-p399
1.8.6-p420
1.8.7-preview1
1.8.7-preview2
1.8.7-preview3
1.8.7-preview4
1.8.7
1.8.7-p17
1.8.7-p22
1.8.7-p71
1.8.7-p72
1.8.7-p160
1.8.7-p173
1.8.7-p174
1.8.7-p248
1.8.7-p249
1.8.7-p299
1.8.7-p301
1.8.7-p302
1.8.7-p330
1.8.7-p334
1.8.7-p352
1.8.7-p357
1.8.7-p358
1.8.7-p370
1.8.7-p371
1.8.7-p373
1.8.7-p374
1.8.7-p375
1.9.0-0
1.9.0-1
1.9.0-2
1.9.0-3
1.9.0-4
1.9.0-5
1.9.1-preview1
1.9.1-preview2
1.9.1-rc1
1.9.1-rc2
1.9.1-p0
1.9.1-p129
1.9.1-p243
1.9.1-p376
1.9.1-p378
1.9.1-p429
1.9.1-p430
1.9.1-p431
1.9.2-preview1
1.9.2-preview3
1.9.2-rc1
1.9.2-rc2
1.9.2-p0
1.9.2-p136
1.9.2-p180
1.9.2-p290
1.9.2-p318
1.9.2-p320
1.9.2-p326
1.9.2-p330
1.9.3-dev
1.9.3-preview1
1.9.3-rc1
1.9.3-p0
1.9.3-p105
1.9.3-p125
1.9.3-p194
1.9.3-p286
1.9.3-p327
1.9.3-p362
1.9.3-p374
1.9.3-p385
1.9.3-p392
1.9.3-p426
1.9.3-p429
1.9.3-p448
1.9.3-p484
1.9.3-p545
1.9.3-p547
1.9.3-p550
1.9.3-p551
2.0.0-dev
2.0.0-preview1
2.0.0-preview2
2.0.0-rc1
2.0.0-rc2
2.0.0-p0
2.0.0-p195
2.0.0-p247
2.0.0-p353
2.0.0-p451
2.0.0-p481
2.0.0-p576
2.0.0-p594
2.0.0-p598
2.0.0-p643
2.0.0-p645
2.0.0-p647
2.0.0-p648
2.1.0-dev
2.1.0-preview1
2.1.0-preview2
2.1.0-rc1
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.1.5
2.1.6
2.1.7
2.1.8
2.1.9
2.1.10
2.2.0-dev
2.2.0-preview1
2.2.0-preview2
2.2.0-rc1
2.2.0
2.2.1
2.2.2
2.2.3
2.2.4
2.2.5
2.2.6
2.2.7
2.3.0-dev
2.3.0-preview1
2.3.0-preview2
2.3.0
2.3.1
2.3.2
2.3.3
2.3.4
2.4.0-dev
2.4.0-preview1
2.4.0-preview2
2.4.0-preview3
2.4.0-rc1
2.4.0
2.4.1
2.5.0-dev
jruby-1.5.6
jruby-1.6.3
jruby-1.6.4
jruby-1.6.5
jruby-1.6.5.1
jruby-1.6.6
jruby-1.6.7
jruby-1.6.7.2
jruby-1.6.8
jruby-1.7.0-preview1
jruby-1.7.0-preview2
jruby-1.7.0-rc1
jruby-1.7.0-rc2
jruby-1.7.0
jruby-1.7.1
jruby-1.7.2
jruby-1.7.3
jruby-1.7.4
jruby-1.7.5
jruby-1.7.6
jruby-1.7.7
jruby-1.7.8
jruby-1.7.9
jruby-1.7.10
jruby-1.7.11
jruby-1.7.12
jruby-1.7.13
jruby-1.7.14
jruby-1.7.15
jruby-1.7.16
jruby-1.7.16.1
jruby-1.7.16.2
jruby-1.7.17
jruby-1.7.18
jruby-1.7.19
jruby-1.7.20
jruby-1.7.20.1
jruby-1.7.21
jruby-1.7.22
jruby-1.7.23
jruby-1.7.24
jruby-1.7.25
jruby-1.7.26
jruby-1.7.27
jruby-9.0.0.0.pre1
jruby-9.0.0.0.pre2
jruby-9.0.0.0.rc1
jruby-9.0.0.0.rc2
jruby-9.0.0.0
jruby-9.0.1.0
jruby-9.0.3.0
jruby-9.0.4.0
jruby-9.0.5.0
jruby-9.1.0.0-dev
jruby-9.1.0.0
jruby-9.1.1.0
jruby-9.1.2.0
jruby-9.1.3.0
jruby-9.1.4.0
jruby-9.1.5.0
jruby-9.1.6.0
jruby-9.1.7.0
jruby-9.1.8.0
jruby-9.1.9.0-dev
jruby-9.1.9.0
jruby-9.1.10.0
jruby-9.1.11.0
jruby-9.1.12.0
maglev-1.0.0
maglev-1.1.0-dev
maglev-2.0.0-dev
mruby-dev
mruby-1.0.0
mruby-1.1.0
mruby-1.2.0
rbx-2.2.2
rbx-2.2.3
rbx-2.2.4
rbx-2.2.5
rbx-2.2.6
rbx-2.2.7
rbx-2.2.8
rbx-2.2.9
rbx-2.2.10
rbx-2.3.0
rbx-2.4.0
rbx-2.4.1
rbx-2.5.0
rbx-2.5.1
rbx-2.5.2
rbx-2.5.3
rbx-2.5.4
rbx-2.5.5
rbx-2.5.6
rbx-2.5.7
rbx-2.5.8
rbx-2.6
rbx-2.7
rbx-2.8
rbx-2.9
rbx-2.10
rbx-2.11
rbx-2.71828182
rbx-3.0
rbx-3.1
rbx-3.2
rbx-3.3
rbx-3.4
rbx-3.5
rbx-3.6
rbx-3.7
rbx-3.8
rbx-3.9
rbx-3.10
rbx-3.11
rbx-3.12
rbx-3.13
rbx-3.14
rbx-3.15
rbx-3.16
rbx-3.17
rbx-3.18
rbx-3.19
rbx-3.20
rbx-3.21
rbx-3.22
rbx-3.23
rbx-3.24
rbx-3.25
rbx-3.26
rbx-3.27
rbx-3.28
rbx-3.29
rbx-3.30
rbx-3.31
rbx-3.32
rbx-3.33
rbx-3.34
rbx-3.35
rbx-3.36
rbx-3.37
rbx-3.38
rbx-3.39
rbx-3.40
rbx-3.41
rbx-3.42
rbx-3.43
rbx-3.44
rbx-3.45
rbx-3.46
rbx-3.47
rbx-3.48
rbx-3.49
rbx-3.50
rbx-3.51
rbx-3.52
rbx-3.53
rbx-3.54
rbx-3.55
rbx-3.56
rbx-3.57
rbx-3.58
rbx-3.59
rbx-3.60
rbx-3.61
rbx-3.62
rbx-3.63
rbx-3.64
rbx-3.65
rbx-3.66
rbx-3.67
rbx-3.68
rbx-3.69
rbx-3.70
rbx-3.71
rbx-3.72
rbx-3.73
rbx-3.74
rbx-3.75
rbx-3.76
rbx-3.77
rbx-3.78
rbx-3.79
rbx-3.80
rbx-3.81
rbx-3.82
ree-1.8.7-2011.03
ree-1.8.7-2011.12
ree-1.8.7-2012.01
ree-1.8.7-2012.02
topaz-dev
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ rbenv install rbx-3.82
Downloading rubinius-3.82.tar.bz2...
-&gt; https://dqw8nmjcqpjn7.cloudfront.net/53abb85219980d7307a762660e1d509cd74beccbcf4d46979ddd0749e77a1401
Installing rubinius-3.82...

BUILD FAILED (Ubuntu 20.04 using ruby-build 20170726)

Inspect or clean up the working tree at /tmp/ruby-build.20230530173243.9015
Results logged to /tmp/ruby-build.20230530173243.9015.log

Last 10 log lines:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /tmp/ruby-build.20230530173243.9015/rubinius-3.82/vendor/bundle/ruby/2.7.0/gems/rubinius-melbourne-3.9/ext/rubinius/code/melbourne
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20230530-9078-1ds9pho.rb extconf.rb ''
extconf failedno implicit conversion of nil into String

Gem files will remain installed in /tmp/ruby-build.20230530173243.9015/rubinius-3.82/vendor/bundle/ruby/2.7.0/gems/rubinius-melbourne-3.9 for inspection.
Results logged to /tmp/ruby-build.20230530173243.9015/rubinius-3.82/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/rubinius-melbourne-3.9/gem_make.out
An error occurred while installing rubinius-melbourne (3.9), and Bundler cannot continue.
Make sure that `gem install rubinius-melbourne -v '3.9'` succeeds before bundling.


10、决定卸载 Ruby 2.7


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo apt-get remove ruby-full
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libc-ares2
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
ruby-full
0 upgraded, 0 newly installed, 1 to remove and 236 not upgraded.
After this operation, 19.5 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 65638 files and directories currently installed.)
Removing ruby-full (1:2.7+1) ...
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ sudo apt-get remove ruby
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
fonts-lato javascript-common libc-ares2 libjs-jquery ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit
ruby-xmlrpc ruby2.7-doc rubygems-integration unzip zip
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
libruby2.7 rake rbenv ri ruby ruby-dev ruby2.7 ruby2.7-dev
0 upgraded, 0 newly installed, 8 to remove and 236 not upgraded.
After this operation, 19.3 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 65634 files and directories currently installed.)
Removing ruby-dev:amd64 (1:2.7+1) ...
Removing ruby2.7-dev:amd64 (2.7.0-5ubuntu1.11) ...
Removing rbenv (1.1.1-1) ...
Removing ri (1:2.7+1) ...
Removing ruby2.7 (2.7.0-5ubuntu1.11) ...
Removing libruby2.7:amd64 (2.7.0-5ubuntu1.11) ...
Removing rake (13.0.1-4) ...
Removing ruby (1:2.7+1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
/sbin/ldconfig.real: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$ ruby -v
-bash: /usr/bin/ruby: No such file or directory
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/shopify-app$


11、作为 rbenv 插件,列出所有可用的 Ruby 版本,执行命令:rbenv install –list ,提示命令不存在,重新安装 rbenv。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot$ rbenv install --list

Command 'rbenv' not found, but can be installed with:

sudo apt install rbenv
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot$ sudo apt install rbenv


12、作为 rbenv 插件,安装 Ruby rbx-3.82 到 ~/.rbenv/versions,执行命令:rbenv install rbx-3.82。安装失败,报错:gem install rubinius-melbourne -v ‘3.9’


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot$ rbenv install rbx-3.82
Downloading rubinius-3.82.tar.bz2...
-&gt; https://dqw8nmjcqpjn7.cloudfront.net/53abb85219980d7307a762660e1d509cd74beccbcf4d46979ddd0749e77a1401
Installing rubinius-3.82...

BUILD FAILED (Ubuntu 20.04 using ruby-build 20170726)

Inspect or clean up the working tree at /tmp/ruby-build.20230531093842.693
Results logged to /tmp/ruby-build.20230531093842.693.log

Last 10 log lines:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /tmp/ruby-build.20230531093842.693/rubinius-3.82/vendor/bundle/ruby/2.7.0/gems/rubinius-melbourne-3.9/ext/rubinius/code/melbourne
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20230531-756-1f7i4tc.rb extconf.rb ''
extconf failedno implicit conversion of nil into String

Gem files will remain installed in /tmp/ruby-build.20230531093842.693/rubinius-3.82/vendor/bundle/ruby/2.7.0/gems/rubinius-melbourne-3.9 for inspection.
Results logged to /tmp/ruby-build.20230531093842.693/rubinius-3.82/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/rubinius-melbourne-3.9/gem_make.out
An error occurred while installing rubinius-melbourne (3.9), and Bundler cannot continue.
Make sure that `gem install rubinius-melbourne -v '3.9'` succeeds before bundling.


13、执行命令:sudo gem install rubinius-melbourne -v ‘3.9’ ,报错:make: *** [Makefile:45: encoding_compat.o] Error 1


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot$ sudo gem install rubinius-melbourne -v '3.9'
[sudo] password for wangqiang:
Fetching rubinius-melbourne-3.9.gem
Building native extensions. This could take a while...
ERROR: Error installing rubinius-melbourne:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.7.0/gems/rubinius-melbourne-3.9/ext/rubinius/code/melbourne
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20230531-774-1d47cv.rb extconf.rb

current directory: /var/lib/gems/2.7.0/gems/rubinius-melbourne-3.9/ext/rubinius/code/melbourne
make "DESTDIR=" clean

current directory: /var/lib/gems/2.7.0/gems/rubinius-melbourne-3.9/ext/rubinius/code/melbourne
make "DESTDIR="
compiling node_types.cpp
node_types.cpp: In function ‘const char* melbourne_1685498084::get_node_type_string(melbourne_1685498084::node_type)’:
node_types.cpp:264:66: warning: ‘%d’ directive output truncated writing between 3 and 10 bytes into a region of size 1 [-Wformat-truncation=]
264 | snprintf(msg, NODE_STRING_MESSAGE_LEN, "unknown node type: %d", node);
| ^~
node_types.cpp:264:46: note: directive argument in the range [121, 2147483647]
264 | snprintf(msg, NODE_STRING_MESSAGE_LEN, "unknown node type: %d", node);
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from node_types.cpp:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin___snprintf_chk’ output between 23 and 30 bytes into a destination of size 20
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling encoding_compat.cpp
In file included from encoding_compat.hpp:7,
from encoding_compat.cpp:1:
melbourne.hpp:28:10: fatal error: ruby.h: No such file or directory
28 | #include "ruby.h"
| ^~~~~~~~
compilation terminated.
make: *** [Makefile:45: encoding_compat.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.7.0/gems/rubinius-melbourne-3.9 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/rubinius-melbourne-3.9/gem_make.out


14、决定更新 gem 至最新版本。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot$ bundle-update
bundle-update: command not found
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot$ sudo gem install bundler
[sudo] password for wangqiang:
Sorry, try again.
[sudo] password for wangqiang:
Fetching bundler-2.4.13.gem
Successfully installed bundler-2.4.13
Parsing documentation for bundler-2.4.13
Installing ri documentation for bundler-2.4.13
Done installing documentation for bundler after 0 seconds
1 gem installed
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot$ bundle-update
bundle-update: command not found


15、在应用设置中,重置 Ubuntu-20.04 后,不再基于包管理器安装 Ruby ,而是基于 rbenv-installer 脚本在您的系统上幂等地安装或更新 rbenv。 如果检测到 Homebrew,安装将使用 brew install/upgrade 继续。 否则,rbenv 安装在 ~/.rbenv 下。 此外,如果 rbenv install 尚不可用,也会安装 ruby-build。如图2
基于 rbenv-installer 脚本在您的系统上幂等地安装或更新 rbenv

图2



wangqiang@DESKTOP-QLPK8QM:~$ sudo apt-get update
wangqiang@DESKTOP-QLPK8QM:~$ wget -q https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer -O- | bash
Installing rbenv with git...
Initialized empty Git repository in /home/wangqiang/.rbenv/.git/
Updating origin
remote: Enumerating objects: 3176, done.
remote: Counting objects: 100% (333/333), done.
remote: Compressing objects: 100% (192/192), done.
remote: Total 3176 (delta 179), reused 252 (delta 129), pack-reused 2843
Receiving objects: 100% (3176/3176), 638.26 KiB | 184.00 KiB/s, done.
Resolving deltas: 100% (1967/1967), done.
From https://github.com/rbenv/rbenv
* [new branch] master -&gt; origin/master
* [new tag] v0.1.0 -&gt; v0.1.0
* [new tag] v0.1.1 -&gt; v0.1.1
* [new tag] v0.1.2 -&gt; v0.1.2
* [new tag] v0.2.0 -&gt; v0.2.0
* [new tag] v0.2.1 -&gt; v0.2.1
* [new tag] v0.3.0 -&gt; v0.3.0
* [new tag] v0.4.0 -&gt; v0.4.0
* [new tag] v1.0.0 -&gt; v1.0.0
* [new tag] v1.1.0 -&gt; v1.1.0
* [new tag] v1.1.1 -&gt; v1.1.1
* [new tag] v1.1.2 -&gt; v1.1.2
* [new tag] v1.2.0 -&gt; v1.2.0
Branch 'master' set up to track remote branch 'master' from 'origin'.
Already on 'master'

Installing ruby-build with git...
Cloning into '/home/wangqiang/.rbenv/plugins/ruby-build'...
remote: Enumerating objects: 13982, done.
remote: Counting objects: 100% (132/132), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 13982 (delta 83), reused 118 (delta 78), pack-reused 13850
Receiving objects: 100% (13982/13982), 2.80 MiB | 46.00 KiB/s, done.
Resolving deltas: 100% (9566/9566), done.

All done!
Note that this installer does NOT edit your shell configuration files:
1. Run `~/.rbenv/bin/rbenv init' to view instructions on how to configure rbenv for your shell.
2. Launch a new terminal window after editing shell configuration files.
3. (Optional) Run the doctor command to verify the installation:
wget -q "https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor" -O- | bash



16、运行 `~/.rbenv/bin/rbenv init’ 查看有关如何为您的 shell 配置 rbenv 的说明。添加 eval “$(/home/wangqiang/.rbenv/bin/rbenv init – bash)” 至 ~/.bashrc,然后重启终端。


wangqiang@DESKTOP-QLPK8QM:~$ ~/.rbenv/bin/rbenv init
# Please add the following line to your `~/.bashrc' file,
# then restart your terminal.

eval "$(/home/wangqiang/.rbenv/bin/rbenv init - bash)"

wangqiang@DESKTOP-QLPK8QM:~$ echo 'eval "$(/home/wangqiang/.rbenv/bin/rbenv init - bash)"' &gt;&gt; ~/.bashrc
wangqiang@DESKTOP-QLPK8QM:~$


17、编辑 shell 配置文件后启动一个新的终端窗口。如图3
编辑 shell 配置文件后启动一个新的终端窗口

图3

18、您可以使用以下命令验证 rbenv 安装的状态,验证通过。


wangqiang@DESKTOP-QLPK8QM:~$ wget -q https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-doctor -O- | bash
Checking for `rbenv' in PATH: /home/wangqiang/.rbenv/bin/rbenv
Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /home/wangqiang/.rbenv/plugins/ruby-build/bin/rbenv-install (ruby-build 20230512)
Counting installed Ruby versions: none
There aren't any Ruby versions installed under `/home/wangqiang/.rbenv/versions'.
You can install Ruby versions like so: rbenv install 3.2.2
Auditing installed plugins: OK


19、执行命令: rbenv install 3.2.2 ,安装失败,报错:No C compiler found, please specify one with the environment variable CC,or configure with an explicit configuration target.


wangqiang@DESKTOP-QLPK8QM:~$ rbenv install --list
3.0.6
3.1.4
3.2.2
jruby-9.4.2.0
mruby-3.2.0
picoruby-3.0.0
truffleruby-22.3.1
truffleruby+graalvm-22.3.1

Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all / -L' to show all local versions.
wangqiang@DESKTOP-QLPK8QM:~$ rbenv install 3.2.2
To follow progress, use 'tail -f /tmp/ruby-build.20230602104329.795.log' or pass --verbose
No system openssl version was found, ensure openssl headers are installed (https://github.com/rbenv/ruby-build/wiki#suggested-build-environment)
Downloading openssl-3.1.0.tar.gz...
-&gt; https://dqw8nmjcqpjn7.cloudfront.net/aaa925ad9828745c4cad9d9efeb273deca820f2cdcf2c3ac7d7c1212b7c497b4
Installing openssl-3.1.0...

BUILD FAILED (Ubuntu 20.04 using ruby-build 20230512)

Inspect or clean up the working tree at /tmp/ruby-build.20230602104329.795.clWddR
Results logged to /tmp/ruby-build.20230602104329.795.log

Last 10 log lines:

/tmp/ruby-build.20230602104329.795.clWddR/openssl-3.1.0 /tmp/ruby-build.20230602104329.795.clWddR ~

Failure! build file wasn't produced.
Please read INSTALL.md and associated NOTES-* files. You may also have to
look over your available compiler tool chain or change your configuration.

ERROR!
No C compiler found, please specify one with the environment variable CC,
or configure with an explicit configuration target.


20、在下载并尝试从源代码编译 Ruby 之前,ruby-build 通常不会验证系统依赖项是否存在。 请确保所有必需的库(例如构建工具和开发标头)已存在于您的系统中。按照建议的构建环境中的说明进行操作。安装依赖项。


wangqiang@DESKTOP-QLPK8QM:~$ sudo apt-get install autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev



21、重新安装 Ruby 3.2.2,设置 Ruby 版本以完成安装并开始使用 Ruby,为这台机器设置默认的 Ruby 版本。如图4
重新安装 Ruby 3.2.2,设置 Ruby 版本以完成安装并开始使用 Ruby,为这台机器设置默认的 Ruby 版本

图4



wangqiang@DESKTOP-QLPK8QM:~$ rbenv install 3.2.2
To follow progress, use 'tail -f /tmp/ruby-build.20230602105714.6877.log' or pass --verbose
Downloading ruby-3.2.2.tar.gz...
-&gt; https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz
Installing ruby-3.2.2...
Installed ruby-3.2.2 to /home/wangqiang/.rbenv/versions/3.2.2

NOTE: to activate this Ruby version as the new default, run: rbenv global 3.2.2
wangqiang@DESKTOP-QLPK8QM:~$ rbenv global 3.2.2
wangqiang@DESKTOP-QLPK8QM:~$ ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
wangqiang@DESKTOP-QLPK8QM:~$


22、继续安装 gems


wangqiang@DESKTOP-QLPK8QM:~$ gem install bundler
Fetching bundler-2.4.13.gem
Successfully installed bundler-2.4.13
Parsing documentation for bundler-2.4.13
Installing ri documentation for bundler-2.4.13
Done installing documentation for bundler after 0 seconds
1 gem installed

A new release of RubyGems is available: 3.4.10 → 3.4.13!
Run `gem update --system 3.4.13` to update your installation.



23、参考 : 使用以下命令安装在 Linux 上安装和运行 Shopify CLI 的所有要求,包含(Ruby development environment (ruby-dev / ruby-devel)、Git、cURL、GCC、g++、Make)。Node.js 与 Ruby 除外。


wangqiang@DESKTOP-QLPK8QM:~$ sudo apt update &amp;&amp; sudo apt upgrade
wangqiang@DESKTOP-QLPK8QM:~$ sudo apt install curl gcc g++ make
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version (4:9.3.0-1ubuntu2).
g++ set to manually installed.
gcc is already the newest version (4:9.3.0-1ubuntu2).
gcc set to manually installed.
make is already the newest version (4.2.1-1.2).
make set to manually installed.
curl is already the newest version (7.68.0-1ubuntu2.18).
curl set to manually installed.
The following packages were automatically installed and are no longer required:
libfwupdplugin1 libxmlb1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
wangqiang@DESKTOP-QLPK8QM:~$ sudo apt install ruby-dev
wangqiang@DESKTOP-QLPK8QM:~$ sudo apt install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version (1:2.25.1-1ubuntu3.11).
git set to manually installed.
The following packages were automatically installed and are no longer required:
libfwupdplugin1 libxmlb1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


24、安装和运行 Shopify CLI 的所有要求全部准备完毕且满足要求。]]>
https://www.shuijingwanwq.com/2023/06/27/7783/feed/ 2
Laravel 8.x 部署至 Heroku,基于 PostgreSQL 实现 https://www.shuijingwanwq.com/2021/12/29/5622/ https://www.shuijingwanwq.com/2021/12/29/5622/#respond Wed, 29 Dec 2021 11:20:55 +0000 https://www.shuijingwanwq.com/?p=5622 浏览量: 114 1、在本地开发环境中,基于 Laravel Sail 已经部署完毕。打开网址:http://weibo.test/ ,响应 200。如图1
在本地开发环境中,基于 Laravel Sail 已经部署完毕。打开网址:http://weibo.test/ ,响应 200。

图1

2、注册一个 Heroku 账号,使用 @163.com ,发现不被允许,最后使用 @gmail.com,才注册成功。如图2
注册一个 Heroku 账号,使用 @163.com ,发现不被允许,最后使用 @gmail.com,才注册成功。

图2

3、在邮箱 @gmail.com 中点击链接以激活帐户。如图3
在邮箱 @gmail.com 中点击链接以激活帐户。

图3

4、参考网址:https://devcenter.heroku.com/articles/heroku-cli 。Heroku 命令行界面 (CLI) 使直接从终端创建和管理 Heroku 应用程序变得容易。 这是使用 Heroku 的重要组成部分。 5、在 WSL2 中的 Ubuntu 系统中,从终端运行以下命令。报错:error: cannot communicate with server: Post http://localhost/v2/snaps/heroku: dial unix /run/snapd.socket: connect: no such file or directory。如图4
在 WSL2 中的 Ubuntu 系统中,从终端运行以下命令。报错:error: cannot communicate with server: Post http://localhost/v2/snaps/heroku: dial unix /run/snapd.socket: connect: no such file or directory。

图4



wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ sudo snap install --classic heroku
error: cannot communicate with server: Post http://localhost/v2/snaps/heroku: dial unix /run/snapd.socket: connect: no such file or directory


6、最终决定使用 Windows 下的软件。为您的 Windows 安装下载合适的安装程序。如图5
最终决定使用 Windows 下的软件。为您的 Windows 安装下载合适的安装程序。

图5

7、安装过程中报错:Error opening file for writing。如图6
安装过程中报错:Error opening file for writing。

图6



Error opening file for writing:

D:\Program Files\heroku\client\bin\node.exe

Click Abort to stop the installation,
Retry to try again, or
Ignore to skip this file.


8、重新安装,以管理员身份运行,不再报错。 9、验证您的安装,要验证您的 CLI 安装,请使用 heroku –version 命令。已经成功安装。如图7
验证您的安装,要验证您的 CLI 安装,请使用 heroku --version 命令。已经成功安装。

图7



PS C:\Users\Lenovo> heroku --version
 »   Warning: Our terms of service have changed: https://dashboard.heroku.com/terms-of-service
heroku/7.53.0 win32-x64 node-v12.21.0
PS C:\Users\Lenovo>


10、安装 CLI 后,运行 heroku login 命令。 系统会提示您输入任意键以转到 Web 浏览器以完成登录。 然后 CLI 会自动让您登录。如图8
安装 CLI 后,运行 heroku login 命令。 系统会提示您输入任意键以转到 Web 浏览器以完成登录。 然后 CLI 会自动让您登录。

图8



PS C:\Users\Lenovo> heroku login
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to https://cli-auth.heroku.com/auth/cli/browser/056bdba3-dbeb-43ee-9ffc-9556ce91ee23?requestor=SFMyNTY.g2gDbQAAAA42Ni4xNzUuMjE2LjIzOW4GAMhVMuV9AWIAAVGA.7UEaCXMegvnax1AIZ5H_XignHykfVPEHFYcOP0NL2uI
Logging in... done
Logged in as shuijingwanwq@gmail.com
PS C:\Users\Lenovo>


11、参考网址:https://devcenter.heroku.com/articles/getting-started-with-php 。因为文档假设 PHP 与 Composer 安装在本地。由于本地环境的 PHP 版本与 Laravel Sail 环境中的版本不一致,决定先将本地环境的 PHP 版本升级至 PHP 8.1。如图9、图10
因为文档假设 PHP 与 Composer 安装在本地。

图9

 
由于本地环境的 PHP 版本与 Laravel Sail 环境中的版本不一致,决定先将本地环境的 PHP 版本升级至 PHP 8.1。

图10

本地环境的版本号:


PS C:\Users\Lenovo> php -v
PHP 7.4.27 (cli) (built: Dec 14 2021 19:52:13) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
PS C:\Users\Lenovo> composer -V
Composer version 2.1.14 2021-11-30 10:51:43
PS C:\Users\Lenovo>


Laravel Sail 环境的版本号:


# php -v
PHP 8.1.0 (cli) (built: Nov 25 2021 20:22:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.0, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.0, Copyright (c), by Zend Technologies
    with Xdebug v3.1.1, Copyright (c) 2002-2021, by Derick Rethans
# composer -V
Composer version 2.1.14 2021-11-30 10:51:43
#


12、升级后的本地环境的 PHP 版本,PHP 8.1.1。


PS C:\Users\Lenovo> php -v
PHP 8.1.1 (cli) (built: Dec 15 2021 10:31:43) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.1, Copyright (c) Zend Technologies
PS C:\Users\Lenovo>


13、进入程序根目录,使用 heroku create 命令在 Heroku 上创建一个新应用。secret-stream-72395 是 Heroku 随机为应用生成的默认名称,每个人生成的名称都不相同。而 https://secret-stream-72395.herokuapp.com/ 则是应用的线上地址。如图11
进入程序根目录,使用 heroku create 命令在 Heroku 上创建一个新应用。secret-stream-72395 是 Heroku 随机为应用生成的默认名称,每个人生成的名称都不相同。而 https://secret-stream-72395.herokuapp.com/ 则是应用的线上地址。

图11



PS E:\wwwroot> cd .\weibo\
PS E:\wwwroot\weibo> heroku create
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Creating app... done, ⬢ secret-stream-72395
https://secret-stream-72395.herokuapp.com/ | https://git.heroku.com/secret-stream-72395.git
PS E:\wwwroot\weibo>


14、Heroku 平台支持多种语言,在进行应用部署时,Heroku 会自动检查应用的代码是用什么语言写的,然后再接着执行一系列针对该语言的操作来准备好程序运行环境。Laravel 应用默认会包含 package.json 文件,但当 Heroku 检查到该文件时,它会认为此应用是用 Node.js 写的,因此我们需要对应用的 buildpack 进行声明,告诉 Heroku 说我们的应用是用 PHP 写的。如图12
对应用的 buildpack 进行声明,告诉 Heroku 说我们的应用是用 PHP 写的

图12



PS E:\wwwroot\weibo> heroku buildpacks:set heroku/php
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Buildpack set. Next release on secret-stream-72395 will use heroku/php.
Run git push heroku main to create a new release using this buildpack.
PS E:\wwwroot\weibo>


15、将代码推送和部署到 Heroku 上。如图13
将代码推送和部署到 Heroku 上

图13

<pre class="wp-block-syntaxhighlighter-code">

PS E:\wwwroot\weibo> git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   docker-compose.yml

PS E:\wwwroot\weibo> git push heroku main
Enumerating objects: 195, done.
Counting objects: 100% (195/195), done.
Delta compression using up to 4 threads
Compressing objects: 100% (169/169), done.
Writing objects: 100% (195/195), 651.34 KiB | 1.41 MiB/s, done.
Total 195 (delta 47), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/php
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote:        - php (8.1.1)
remote:        - ext-mbstring (bundled with php)
remote:        - composer (2.1.14)
remote:        - apache (2.4.51)
remote:        - nginx (1.20.2)
remote: -----> Installing dependencies...
remote:        Composer version 2.1.14 2021-11-30 10:51:43
remote:        Installing dependencies from lock file
remote:        Verifying lock file contents can be installed on current platform.
remote:        Package operations: 70 installs, 0 updates, 0 removals
remote:          - Downloading doctrine/inflector (2.0.4)
remote:          - Downloading doctrine/lexer (1.2.1)
remote:          - Downloading symfony/polyfill-ctype (v1.23.0)
remote:          - Downloading webmozart/assert (1.10.0)
remote:          - Downloading dragonmantank/cron-expression (v3.1.0)
remote:          - Downloading symfony/polyfill-php80 (v1.23.1)
remote:          - Downloading symfony/polyfill-php73 (v1.23.0)
remote:          - Downloading symfony/polyfill-mbstring (v1.23.1)
remote:          - Downloading symfony/deprecation-contracts (v3.0.0)
remote:          - Downloading symfony/http-foundation (v5.4.1)
remote:          - Downloading psr/event-dispatcher (1.0.0)
remote:          - Downloading symfony/event-dispatcher-contracts (v3.0.0)
remote:          - Downloading symfony/event-dispatcher (v6.0.1)
remote:          - Downloading symfony/var-dumper (v5.4.1)
remote:          - Downloading psr/log (2.0.0)
remote:          - Downloading symfony/error-handler (v5.4.1)
remote:          - Downloading symfony/http-kernel (v5.4.1)
remote:          - Downloading voku/portable-ascii (1.5.6)
remote:          - Downloading phpoption/phpoption (1.8.1)
remote:          - Downloading graham-campbell/result-type (v1.0.4)
remote:          - Downloading vlucas/phpdotenv (v5.4.1)
remote:          - Downloading symfony/css-selector (v6.0.1)
remote:          - Downloading tijsverkoyen/css-to-inline-styles (2.2.4)
remote:          - Downloading symfony/routing (v5.4.0)
remote:          - Downloading symfony/process (v5.4.0)
remote:          - Downloading symfony/polyfill-php72 (v1.23.0)
remote:          - Downloading symfony/polyfill-intl-normalizer (v1.23.0)
remote:          - Downloading symfony/polyfill-intl-idn (v1.23.0)
remote:          - Downloading symfony/mime (v5.4.0)
remote:          - Downloading symfony/finder (v5.4.0)
remote:          - Downloading symfony/polyfill-intl-grapheme (v1.23.1)
remote:          - Downloading symfony/string (v6.0.1)
remote:          - Downloading psr/container (1.1.2)
remote:          - Downloading symfony/service-contracts (v2.4.1)
remote:          - Downloading symfony/console (v5.4.1)
remote:          - Downloading symfony/polyfill-iconv (v1.23.0)
remote:          - Downloading egulias/email-validator (2.1.25)
remote:          - Downloading swiftmailer/swiftmailer (v6.3.0)
remote:          - Downloading symfony/polyfill-php81 (v1.23.0)
remote:          - Downloading ramsey/collection (1.2.2)
remote:          - Downloading brick/math (0.9.3)
remote:          - Downloading ramsey/uuid (4.2.3)
remote:          - Downloading psr/simple-cache (1.0.1)
remote:          - Downloading opis/closure (3.6.2)
remote:          - Downloading symfony/translation-contracts (v3.0.0)
remote:          - Downloading symfony/translation (v6.0.1)
remote:          - Downloading nesbot/carbon (2.55.2)
remote:          - Downloading monolog/monolog (2.3.5)
remote:          - Downloading league/mime-type-detection (1.9.0)
remote:          - Downloading league/flysystem (1.1.9)
remote:          - Downloading nette/utils (v3.2.6)
remote:          - Downloading nette/schema (v1.2.2)
remote:          - Downloading dflydev/dot-access-data (v3.0.1)
remote:          - Downloading league/config (v1.1.1)
remote:          - Downloading league/commonmark (2.1.0)
remote:          - Downloading laravel/serializable-closure (v1.0.5)
remote:          - Downloading laravel/framework (v8.76.2)
remote:          - Downloading asm89/stack-cors (v2.0.3)
remote:          - Downloading fruitcake/laravel-cors (v2.0.4)
remote:          - Downloading psr/http-message (1.0.1)
remote:          - Downloading psr/http-client (1.0.1)
remote:          - Downloading ralouphie/getallheaders (3.0.3)
remote:          - Downloading psr/http-factory (1.0.1)
remote:          - Downloading guzzlehttp/psr7 (2.1.0)
remote:          - Downloading guzzlehttp/promises (1.5.1)
remote:          - Downloading guzzlehttp/guzzle (7.4.1)
remote:          - Downloading laravel/sanctum (v2.13.0)
remote:          - Downloading nikic/php-parser (v4.13.2)
remote:          - Downloading psy/psysh (v0.10.12)
remote:          - Downloading laravel/tinker (v2.6.3)
remote:          - Installing doctrine/inflector (2.0.4): Extracting archive
remote:          - Installing doctrine/lexer (1.2.1): Extracting archive
remote:          - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
remote:          - Installing webmozart/assert (1.10.0): Extracting archive
remote:          - Installing dragonmantank/cron-expression (v3.1.0): Extracting archive
remote:          - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
remote:          - Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
remote:          - Installing symfony/deprecation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/http-foundation (v5.4.1): Extracting archive
remote:          - Installing psr/event-dispatcher (1.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher (v6.0.1): Extracting archive
remote:          - Installing symfony/var-dumper (v5.4.1): Extracting archive
remote:          - Installing psr/log (2.0.0): Extracting archive
remote:          - Installing symfony/error-handler (v5.4.1): Extracting archive
remote:          - Installing symfony/http-kernel (v5.4.1): Extracting archive
remote:          - Installing voku/portable-ascii (1.5.6): Extracting archive
remote:          - Installing phpoption/phpoption (1.8.1): Extracting archive
remote:          - Installing graham-campbell/result-type (v1.0.4): Extracting archive
remote:          - Installing vlucas/phpdotenv (v5.4.1): Extracting archive
remote:          - Installing symfony/css-selector (v6.0.1): Extracting archive
remote:          - Installing tijsverkoyen/css-to-inline-styles (2.2.4): Extracting archive
remote:          - Installing symfony/routing (v5.4.0): Extracting archive
remote:          - Installing symfony/process (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-php72 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-idn (v1.23.0): Extracting archive
remote:          - Installing symfony/mime (v5.4.0): Extracting archive
remote:          - Installing symfony/finder (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive
remote:          - Installing symfony/string (v6.0.1): Extracting archive
remote:          - Installing psr/container (1.1.2): Extracting archive
remote:          - Installing symfony/service-contracts (v2.4.1): Extracting archive
remote:          - Installing symfony/console (v5.4.1): Extracting archive
remote:          - Installing symfony/polyfill-iconv (v1.23.0): Extracting archive
remote:          - Installing egulias/email-validator (2.1.25): Extracting archive
remote:          - Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
remote:          - Installing symfony/polyfill-php81 (v1.23.0): Extracting archive
remote:          - Installing ramsey/collection (1.2.2): Extracting archive
remote:          - Installing brick/math (0.9.3): Extracting archive
remote:          - Installing ramsey/uuid (4.2.3): Extracting archive
remote:          - Installing psr/simple-cache (1.0.1): Extracting archive
remote:          - Installing opis/closure (3.6.2): Extracting archive
remote:          - Installing symfony/translation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/translation (v6.0.1): Extracting archive
remote:          - Installing nesbot/carbon (2.55.2): Extracting archive
remote:          - Installing monolog/monolog (2.3.5): Extracting archive
remote:          - Installing league/mime-type-detection (1.9.0): Extracting archive
remote:          - Installing league/flysystem (1.1.9): Extracting archive
remote:          - Installing nette/utils (v3.2.6): Extracting archive
remote:          - Installing nette/schema (v1.2.2): Extracting archive
remote:          - Installing dflydev/dot-access-data (v3.0.1): Extracting archive
remote:          - Installing league/config (v1.1.1): Extracting archive
remote:          - Installing league/commonmark (2.1.0): Extracting archive
remote:          - Installing laravel/serializable-closure (v1.0.5): Extracting archive
remote:          - Installing laravel/framework (v8.76.2): Extracting archive
remote:          - Installing asm89/stack-cors (v2.0.3): Extracting archive
remote:          - Installing fruitcake/laravel-cors (v2.0.4): Extracting archive
remote:          - Installing psr/http-message (1.0.1): Extracting archive
remote:          - Installing psr/http-client (1.0.1): Extracting archive
remote:          - Installing ralouphie/getallheaders (3.0.3): Extracting archive
remote:          - Installing psr/http-factory (1.0.1): Extracting archive
remote:          - Installing guzzlehttp/psr7 (2.1.0): Extracting archive
remote:          - Installing guzzlehttp/promises (1.5.1): Extracting archive
remote:          - Installing guzzlehttp/guzzle (7.4.1): Extracting archive
remote:          - Installing laravel/sanctum (v2.13.0): Extracting archive
remote:          - Installing nikic/php-parser (v4.13.2): Extracting archive
remote:          - Installing psy/psysh (v0.10.12): Extracting archive
remote:          - Installing laravel/tinker (v2.6.3): Extracting archive
remote:        Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
remote:        Generating optimized autoload files
remote:        > Illuminate\Foundation\ComposerScripts::postAutoloadDump
remote:        > @php artisan package:discover --ansi
remote:        Discovered Package: fruitcake/laravel-cors
remote:        Discovered Package: laravel/sanctum
remote:        Discovered Package: laravel/tinker
remote:        Discovered Package: nesbot/carbon
remote:        Package manifest generated successfully.
remote:        49 packages you are using are looking for funding.
remote:        Use the `composer fund` command to find out more!
remote: -----> Preparing runtime environment...
remote:        NOTICE: No Procfile, using 'web: heroku-php-apache2'.
remote: -----> Checking for additional extensions to install...
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 19.8M
remote: -----> Launching...
remote:        Released v3
remote:        https://secret-stream-72395.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/secret-stream-72395.git
 * [new branch]      main -> main
PS E:\wwwroot\weibo>

</pre>
16、应用程序现已部署。 确保至少有一个应用实例正在运行,现在通过应用程序名称生成的 URL 访问该应用程序。 作为一个方便的快捷方式,您可以按如下方式打开网站。如图14
应用程序现已部署。 确保至少有一个应用实例正在运行,现在通过应用程序名称生成的 URL 访问该应用程序。 作为一个方便的快捷方式,您可以按如下方式打开网站。

图14



PS E:\wwwroot\weibo> heroku ps:scale web=1
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Scaling dynos... done, now running web at 1:Free
PS E:\wwwroot\weibo> heroku open
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
PS E:\wwwroot\weibo>


17、但是,在浏览器中自动打开网站:https://secret-stream-72395.herokuapp.com/ ,响应 403。如图15
但是,在浏览器中自动打开网站:https://secret-stream-72395.herokuapp.com/ ,响应 403。

图15



Forbidden
You don't have permission to access this resource.


18、在步骤 15 中提示:No Procfile, using ‘web: heroku-php-apache2’。Laravel 项目下新建一个 Procfile 文件,通过配置该文件来告诉 Heroku 应当使用什么命令来启动 Web 服务器。接着还需要将该文件纳入到 Git 版本控制中。报错:Push failed: cannot parse Procfile.。如图16
报错:Push failed: cannot parse Procfile.

图16



PS E:\wwwroot\weibo> echo web: vendor/bin/heroku-php-apache2 public/ > Procfile
PS E:\wwwroot\weibo> git add -A
PS E:\wwwroot\weibo> git commit -m "Procfile for Heroku"
[main 64256ed] Procfile for Heroku
 2 files changed, 6 insertions(+), 6 deletions(-)
 create mode 100644 Procfile
PS E:\wwwroot\weibo> git push heroku main
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 4 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 496 bytes | 496.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/php
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote:        - php (8.1.1)
remote:        - ext-mbstring (bundled with php)
remote:        - composer (2.1.14)
remote:        - apache (2.4.51)
remote:        - nginx (1.20.2)
remote: -----> Installing dependencies...
remote:        Composer version 2.1.14 2021-11-30 10:51:43
remote:        Installing dependencies from lock file
remote:        Verifying lock file contents can be installed on current platform.
remote:        Package operations: 70 installs, 0 updates, 0 removals
remote:          - Installing doctrine/inflector (2.0.4): Extracting archive
remote:          - Installing doctrine/lexer (1.2.1): Extracting archive
remote:          - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
remote:          - Installing webmozart/assert (1.10.0): Extracting archive
remote:          - Installing dragonmantank/cron-expression (v3.1.0): Extracting archive
remote:          - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
remote:          - Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
remote:          - Installing symfony/deprecation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/http-foundation (v5.4.1): Extracting archive
remote:          - Installing psr/event-dispatcher (1.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher (v6.0.1): Extracting archive
remote:          - Installing symfony/var-dumper (v5.4.1): Extracting archive
remote:          - Installing psr/log (2.0.0): Extracting archive
remote:          - Installing symfony/error-handler (v5.4.1): Extracting archive
remote:          - Installing symfony/http-kernel (v5.4.1): Extracting archive
remote:          - Installing voku/portable-ascii (1.5.6): Extracting archive
remote:          - Installing phpoption/phpoption (1.8.1): Extracting archive
remote:          - Installing graham-campbell/result-type (v1.0.4): Extracting archive
remote:          - Installing vlucas/phpdotenv (v5.4.1): Extracting archive
remote:          - Installing symfony/css-selector (v6.0.1): Extracting archive
remote:          - Installing tijsverkoyen/css-to-inline-styles (2.2.4): Extracting archive
remote:          - Installing symfony/routing (v5.4.0): Extracting archive
remote:          - Installing symfony/process (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-php72 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-idn (v1.23.0): Extracting archive
remote:          - Installing symfony/mime (v5.4.0): Extracting archive
remote:          - Installing symfony/finder (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive
remote:          - Installing symfony/string (v6.0.1): Extracting archive
remote:          - Installing psr/container (1.1.2): Extracting archive
remote:          - Installing symfony/service-contracts (v2.4.1): Extracting archive
remote:          - Installing symfony/console (v5.4.1): Extracting archive
remote:          - Installing symfony/polyfill-iconv (v1.23.0): Extracting archive
remote:          - Installing egulias/email-validator (2.1.25): Extracting archive
remote:          - Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
remote:          - Installing symfony/polyfill-php81 (v1.23.0): Extracting archive
remote:          - Installing ramsey/collection (1.2.2): Extracting archive
remote:          - Installing brick/math (0.9.3): Extracting archive
remote:          - Installing ramsey/uuid (4.2.3): Extracting archive
remote:          - Installing psr/simple-cache (1.0.1): Extracting archive
remote:          - Installing opis/closure (3.6.2): Extracting archive
remote:          - Installing symfony/translation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/translation (v6.0.1): Extracting archive
remote:          - Installing nesbot/carbon (2.55.2): Extracting archive
remote:          - Installing monolog/monolog (2.3.5): Extracting archive
remote:          - Installing league/mime-type-detection (1.9.0): Extracting archive
remote:          - Installing league/flysystem (1.1.9): Extracting archive
remote:          - Installing nette/utils (v3.2.6): Extracting archive
remote:          - Installing nette/schema (v1.2.2): Extracting archive
remote:          - Installing dflydev/dot-access-data (v3.0.1): Extracting archive
remote:          - Installing league/config (v1.1.1): Extracting archive
remote:          - Installing league/commonmark (2.1.0): Extracting archive
remote:          - Installing laravel/serializable-closure (v1.0.5): Extracting archive
remote:          - Installing laravel/framework (v8.76.2): Extracting archive
remote:          - Installing asm89/stack-cors (v2.0.3): Extracting archive
remote:          - Installing fruitcake/laravel-cors (v2.0.4): Extracting archive
remote:          - Installing psr/http-message (1.0.1): Extracting archive
remote:          - Installing psr/http-client (1.0.1): Extracting archive
remote:          - Installing ralouphie/getallheaders (3.0.3): Extracting archive
remote:          - Installing psr/http-factory (1.0.1): Extracting archive
remote:          - Installing guzzlehttp/psr7 (2.1.0): Extracting archive
remote:          - Installing guzzlehttp/promises (1.5.1): Extracting archive
remote:          - Installing guzzlehttp/guzzle (7.4.1): Extracting archive
remote:          - Installing laravel/sanctum (v2.13.0): Extracting archive
remote:          - Installing nikic/php-parser (v4.13.2): Extracting archive
remote:          - Installing psy/psysh (v0.10.12): Extracting archive
remote:          - Installing laravel/tinker (v2.6.3): Extracting archive
remote:        Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
remote:        Generating optimized autoload files
remote:        > Illuminate\Foundation\ComposerScripts::postAutoloadDump
remote:        > @php artisan package:discover --ansi
remote:        Discovered Package: fruitcake/laravel-cors
remote:        Discovered Package: laravel/sanctum
remote:        Discovered Package: laravel/tinker
remote:        Discovered Package: nesbot/carbon
remote:        Package manifest generated successfully.
remote:        49 packages you are using are looking for funding.
remote:        Use the `composer fund` command to find out more!
remote: -----> Preparing runtime environment...
remote: -----> Checking for additional extensions to install...
remote: -----> Discovering process types
remote:
remote:  !     Push failed: cannot parse Procfile.
remote:  !     Please try pushing again.
remote:  !     If the problem persists, see https://help.heroku.com/ and provide Request ID f09b381f-8217-327d-d121-119f1e8d0c31.
remote:
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to secret-stream-72395.
remote:
To https://git.heroku.com/secret-stream-72395.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/secret-stream-72395.git'
PS E:\wwwroot\weibo>


19、查看文件 Procfile 的内容,如图17
查看文件 Procfile 的内容

图17



web:
vendor/bin/heroku-php-apache2
public/



20、参考 Getting Started with Laravel on Heroku:https://devcenter.heroku.com/articles/getting-started-with-laravel 。查看文件 Procfile 的内容,如图18
参考 Getting Started with Laravel on Heroku:https://devcenter.heroku.com/articles/getting-started-with-laravel 。查看文件 Procfile 的内容

图18



PS E:\wwwroot\weibo> echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile
PS E:\wwwroot\weibo> git add .
PS E:\wwwroot\weibo> git commit -m "Procfile for Heroku"
[main a30f3dd] Procfile for Heroku
 1 file changed, 0 insertions(+), 0 deletions(-)


21、设置 Laravel 加密密钥,使用 Laravel 自带的 artisan 命令来生成 App Key。如图19
设置 Laravel 加密密钥,使用 Laravel 自带的 artisan 命令来生成 App Key。

图19



PS E:\wwwroot\weibo> php artisan key:generate --show
base64:qtlcYLZF38gHDz/XhCE/cc0Q+BwByRygnVpfWwtRipA=
PS E:\wwwroot\weibo>


22、基于生成的 App Key ,运行该命令行来完成配置。如图20
基于生成的 App Key ,运行该命令行来完成配置。

图20



PS E:\wwwroot\weibo> heroku config:set APP_KEY=base64:qtlcYLZF38gHDz/XhCE/cc0Q+BwByRygnVpfWwtRipA=
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Setting APP_KEY and restarting ⬢ secret-stream-72395... done, v4
APP_KEY: base64:qtlcYLZF38gHDz/XhCE/cc0Q+BwByRygnVpfWwtRipA=
PS E:\wwwroot\weibo>


23、推送时,仍然报错:Push failed: cannot parse Procfile.
<pre class="wp-block-syntaxhighlighter-code">

PS E:\wwwroot\weibo> git push heroku main:main
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 4 threads
Compressing objects: 100% (17/17), done.
Writing objects: 100% (17/17), 1.59 KiB | 542.00 KiB/s, done.
Total 17 (delta 8), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/php
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote:        - php (8.1.1)
remote:        - ext-mbstring (bundled with php)
remote:        - composer (2.1.14)
remote:        - apache (2.4.51)
remote:        - nginx (1.20.2)
remote: -----> Installing dependencies...
remote:        Composer version 2.1.14 2021-11-30 10:51:43
remote:        Installing dependencies from lock file
remote:        Verifying lock file contents can be installed on current platform.
remote:        Package operations: 70 installs, 0 updates, 0 removals
remote:          - Installing doctrine/inflector (2.0.4): Extracting archive
remote:          - Installing doctrine/lexer (1.2.1): Extracting archive
remote:          - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
remote:          - Installing webmozart/assert (1.10.0): Extracting archive
remote:          - Installing dragonmantank/cron-expression (v3.1.0): Extracting archive
remote:          - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
remote:          - Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
remote:          - Installing symfony/deprecation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/http-foundation (v5.4.1): Extracting archive
remote:          - Installing psr/event-dispatcher (1.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher (v6.0.1): Extracting archive
remote:          - Installing symfony/var-dumper (v5.4.1): Extracting archive
remote:          - Installing psr/log (2.0.0): Extracting archive
remote:          - Installing symfony/error-handler (v5.4.1): Extracting archive
remote:          - Installing symfony/http-kernel (v5.4.1): Extracting archive
remote:          - Installing voku/portable-ascii (1.5.6): Extracting archive
remote:          - Installing phpoption/phpoption (1.8.1): Extracting archive
remote:          - Installing graham-campbell/result-type (v1.0.4): Extracting archive
remote:          - Installing vlucas/phpdotenv (v5.4.1): Extracting archive
remote:          - Installing symfony/css-selector (v6.0.1): Extracting archive
remote:          - Installing tijsverkoyen/css-to-inline-styles (2.2.4): Extracting archive
remote:          - Installing symfony/routing (v5.4.0): Extracting archive
remote:          - Installing symfony/process (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-php72 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-idn (v1.23.0): Extracting archive
remote:          - Installing symfony/mime (v5.4.0): Extracting archive
remote:          - Installing symfony/finder (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive
remote:          - Installing symfony/string (v6.0.1): Extracting archive
remote:          - Installing psr/container (1.1.2): Extracting archive
remote:          - Installing symfony/service-contracts (v2.4.1): Extracting archive
remote:          - Installing symfony/console (v5.4.1): Extracting archive
remote:          - Installing symfony/polyfill-iconv (v1.23.0): Extracting archive
remote:          - Installing egulias/email-validator (2.1.25): Extracting archive
remote:          - Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
remote:          - Installing symfony/polyfill-php81 (v1.23.0): Extracting archive
remote:          - Installing ramsey/collection (1.2.2): Extracting archive
remote:          - Installing brick/math (0.9.3): Extracting archive
remote:          - Installing ramsey/uuid (4.2.3): Extracting archive
remote:          - Installing psr/simple-cache (1.0.1): Extracting archive
remote:          - Installing opis/closure (3.6.2): Extracting archive
remote:          - Installing symfony/translation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/translation (v6.0.1): Extracting archive
remote:          - Installing nesbot/carbon (2.55.2): Extracting archive
remote:          - Installing monolog/monolog (2.3.5): Extracting archive
remote:          - Installing league/mime-type-detection (1.9.0): Extracting archive
remote:          - Installing league/flysystem (1.1.9): Extracting archive
remote:          - Installing nette/utils (v3.2.6): Extracting archive
remote:          - Installing nette/schema (v1.2.2): Extracting archive
remote:          - Installing dflydev/dot-access-data (v3.0.1): Extracting archive
remote:          - Installing league/config (v1.1.1): Extracting archive
remote:          - Installing league/commonmark (2.1.0): Extracting archive
remote:          - Installing laravel/serializable-closure (v1.0.5): Extracting archive
remote:          - Installing laravel/framework (v8.76.2): Extracting archive
remote:          - Installing asm89/stack-cors (v2.0.3): Extracting archive
remote:          - Installing fruitcake/laravel-cors (v2.0.4): Extracting archive
remote:          - Installing psr/http-message (1.0.1): Extracting archive
remote:          - Installing psr/http-client (1.0.1): Extracting archive
remote:          - Installing ralouphie/getallheaders (3.0.3): Extracting archive
remote:          - Installing psr/http-factory (1.0.1): Extracting archive
remote:          - Installing guzzlehttp/psr7 (2.1.0): Extracting archive
remote:          - Installing guzzlehttp/promises (1.5.1): Extracting archive
remote:          - Installing guzzlehttp/guzzle (7.4.1): Extracting archive
remote:          - Installing laravel/sanctum (v2.13.0): Extracting archive
remote:          - Installing nikic/php-parser (v4.13.2): Extracting archive
remote:          - Installing psy/psysh (v0.10.12): Extracting archive
remote:          - Installing laravel/tinker (v2.6.3): Extracting archive
remote:        Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
remote:        Generating optimized autoload files
remote:        > Illuminate\Foundation\ComposerScripts::postAutoloadDump
remote:        > @php artisan package:discover --ansi
remote:        Discovered Package: fruitcake/laravel-cors
remote:        Discovered Package: laravel/sanctum
remote:        Discovered Package: laravel/tinker
remote:        Discovered Package: nesbot/carbon
remote:        Package manifest generated successfully.
remote:        49 packages you are using are looking for funding.
remote:        Use the `composer fund` command to find out more!
remote: -----> Preparing runtime environment...
remote: -----> Checking for additional extensions to install...
remote: -----> Discovering process types
remote:
remote:  !     Push failed: cannot parse Procfile.
remote:  !     Please try pushing again.
remote:  !     If the problem persists, see https://help.heroku.com/ and provide Request ID 691561db-a116-53f5-a4e5-0100a3777ce9.
remote:
remote:
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: a30f3dde79d674408b2fb440cda5f9dbeb2204fe
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version a30f3dde79d674408b2fb440cda5f9dbeb2204fe
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to secret-stream-72395.
remote:
To https://git.heroku.com/secret-stream-72395.git
 ! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/secret-stream-72395.git'
PS E:\wwwroot\weibo>

</pre>
24、将文件编码另存为 UTF-8 。如图21
将文件编码另存为 UTF-8 。

图21

25、推送成功,且打开网址:https://secret-stream-72395.herokuapp.com/ ,响应 200。如图22
推送成功,且打开网址:https://secret-stream-72395.herokuapp.com/ ,响应 200。

图22



PS E:\wwwroot\weibo> git add .
PS E:\wwwroot\weibo> git commit -m "Procfile for Heroku"
[main 362c878] Procfile for Heroku
 1 file changed, 0 insertions(+), 0 deletions(-)
PS E:\wwwroot\weibo> git push heroku main
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 4 threads
Compressing objects: 100% (19/19), done.
Writing objects: 100% (20/20), 1.84 KiB | 470.00 KiB/s, done.
Total 20 (delta 9), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/php
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote:        - php (8.1.1)
remote:        - ext-mbstring (bundled with php)
remote:        - composer (2.1.14)
remote:        - apache (2.4.51)
remote:        - nginx (1.20.2)
remote: -----> Installing dependencies...
remote:        Composer version 2.1.14 2021-11-30 10:51:43
remote:        Installing dependencies from lock file
remote:        Verifying lock file contents can be installed on current platform.
remote:        Package operations: 70 installs, 0 updates, 0 removals
remote:          - Installing doctrine/inflector (2.0.4): Extracting archive
remote:          - Installing doctrine/lexer (1.2.1): Extracting archive
remote:          - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
remote:          - Installing webmozart/assert (1.10.0): Extracting archive
remote:          - Installing dragonmantank/cron-expression (v3.1.0): Extracting archive
remote:          - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
remote:          - Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
remote:          - Installing symfony/deprecation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/http-foundation (v5.4.1): Extracting archive
remote:          - Installing psr/event-dispatcher (1.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher (v6.0.1): Extracting archive
remote:          - Installing symfony/var-dumper (v5.4.1): Extracting archive
remote:          - Installing psr/log (2.0.0): Extracting archive
remote:          - Installing symfony/error-handler (v5.4.1): Extracting archive
remote:          - Installing symfony/http-kernel (v5.4.1): Extracting archive
remote:          - Installing voku/portable-ascii (1.5.6): Extracting archive
remote:          - Installing phpoption/phpoption (1.8.1): Extracting archive
remote:          - Installing graham-campbell/result-type (v1.0.4): Extracting archive
remote:          - Installing vlucas/phpdotenv (v5.4.1): Extracting archive
remote:          - Installing symfony/css-selector (v6.0.1): Extracting archive
remote:          - Installing tijsverkoyen/css-to-inline-styles (2.2.4): Extracting archive
remote:          - Installing symfony/routing (v5.4.0): Extracting archive
remote:          - Installing symfony/process (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-php72 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-idn (v1.23.0): Extracting archive
remote:          - Installing symfony/mime (v5.4.0): Extracting archive
remote:          - Installing symfony/finder (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive
remote:          - Installing symfony/string (v6.0.1): Extracting archive
remote:          - Installing psr/container (1.1.2): Extracting archive
remote:          - Installing symfony/service-contracts (v2.4.1): Extracting archive
remote:          - Installing symfony/console (v5.4.1): Extracting archive
remote:          - Installing symfony/polyfill-iconv (v1.23.0): Extracting archive
remote:          - Installing egulias/email-validator (2.1.25): Extracting archive
remote:          - Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
remote:          - Installing symfony/polyfill-php81 (v1.23.0): Extracting archive
remote:          - Installing ramsey/collection (1.2.2): Extracting archive
remote:          - Installing brick/math (0.9.3): Extracting archive
remote:          - Installing ramsey/uuid (4.2.3): Extracting archive
remote:          - Installing psr/simple-cache (1.0.1): Extracting archive
remote:          - Installing opis/closure (3.6.2): Extracting archive
remote:          - Installing symfony/translation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/translation (v6.0.1): Extracting archive
remote:          - Installing nesbot/carbon (2.55.2): Extracting archive
remote:          - Installing monolog/monolog (2.3.5): Extracting archive
remote:          - Installing league/mime-type-detection (1.9.0): Extracting archive
remote:          - Installing league/flysystem (1.1.9): Extracting archive
remote:          - Installing nette/utils (v3.2.6): Extracting archive
remote:          - Installing nette/schema (v1.2.2): Extracting archive
remote:          - Installing dflydev/dot-access-data (v3.0.1): Extracting archive
remote:          - Installing league/config (v1.1.1): Extracting archive
remote:          - Installing league/commonmark (2.1.0): Extracting archive
remote:          - Installing laravel/serializable-closure (v1.0.5): Extracting archive
remote:          - Installing laravel/framework (v8.76.2): Extracting archive
remote:          - Installing asm89/stack-cors (v2.0.3): Extracting archive
remote:          - Installing fruitcake/laravel-cors (v2.0.4): Extracting archive
remote:          - Installing psr/http-message (1.0.1): Extracting archive
remote:          - Installing psr/http-client (1.0.1): Extracting archive
remote:          - Installing ralouphie/getallheaders (3.0.3): Extracting archive
remote:          - Installing psr/http-factory (1.0.1): Extracting archive
remote:          - Installing guzzlehttp/psr7 (2.1.0): Extracting archive
remote:          - Installing guzzlehttp/promises (1.5.1): Extracting archive
remote:          - Installing guzzlehttp/guzzle (7.4.1): Extracting archive
remote:          - Installing nikic/php-parser (v4.13.2): Extracting archive
remote:          - Installing psy/psysh (v0.10.12): Extracting archive
remote:          - Installing laravel/tinker (v2.6.3): Extracting archive
remote:        Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
remote:        Generating optimized autoload files
remote:        > Illuminate\Foundation\ComposerScripts::postAutoloadDump
remote:        > @php artisan package:discover --ansi
remote:        Discovered Package: fruitcake/laravel-cors
remote:        Discovered Package: laravel/sanctum
remote:        Discovered Package: laravel/tinker
remote:        Discovered Package: nesbot/carbon
remote:        Package manifest generated successfully.
remote:        49 packages you are using are looking for funding.
remote:        Use the `composer fund` command to find out more!
remote: -----> Preparing runtime environment...
remote: -----> Checking for additional extensions to install...
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 19.8M
remote: -----> Launching...
remote:        Released v6
remote:        https://secret-stream-72395.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/secret-stream-72395.git
   e72b466..362c878  main -> main
PS E:\wwwroot\weibo> heroku open
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
PS E:\wwwroot\weibo>


26、但是,在提交表单,写入数据至 MySQL 时,响应 500 服务器错误,原因在于数据库还不存在。如图23
在提交表单,写入数据至 MySQL 时,响应 500 服务器错误,原因在于数据库还不存在。

图23

27、在 Heroku 上使用 PostgreSQL 来作为我们应用的数据库。安装 PostgreSQL 扩展。Heroku 将为我们生成一个唯一的数据库 URL – DATABASE_URL,我们可以通过命令:heroku config 查看 Heroku 的所有配置信息。如图24
在 Heroku 上使用 PostgreSQL 来作为我们应用的数据库。安装 PostgreSQL 扩展。Heroku 将为我们生成一个唯一的数据库 URL - DATABASE_URL,我们可以通过命令:heroku config 查看 Heroku 的所有配置信息。

图24



PS E:\wwwroot\weibo> heroku addons:add heroku-postgresql:hobby-dev
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Creating heroku-postgresql:hobby-dev on ⬢ secret-stream-72395... free
Database has been created and is available
 ! This database is empty. If upgrading, you can transfer
 ! data from another database with pg:copy
Created postgresql-parallel-13694 as DATABASE_URL
Use heroku addons:docs heroku-postgresql to view documentation
PS E:\wwwroot\weibo> heroku config
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
=== secret-stream-72395 Config Vars
APP_KEY:      base64:TXoum9anbYcE/VGilCjxrSQQ5E4cR5UVb+55SjIsbg0=
DATABASE_URL: postgres://eayusxxdstiniz:31d9e092c4c8d1740380641299d36711b04e72b98e2f92b9be4253153087bbea@ec2-52-200-28-255.compute-1.amazonaws.com:5432/d9nb3l2ot2cutp
PS E:\wwwroot\weibo>


28、在本地开发中,我们使用了 MySQL 来作为数据库储存,但在 Heroku 环境上我们要改为使用 PostgreSQL 来作为数据库储存。因此在进行数据库设置时,我们需要对当前环境进行判断。如果环境为本地环境,则使用 MySQL 数据库,若为 Heroku 环境,则使用 PostgreSQL 数据库。我们可以通过为 Heroku 新增一个 IS_IN_HEROKU 配置项来判断应用是否运行在 Heroku 上。一般来说,应用的数据库都在 config/database.php 中进行配置,因此我们需要针对该配置文件,来为不同环境的数据库连接方式定义一个帮助方法,以便根据应用不同的运行环境来指定数据库配置信息,我们需要新建一个 helpers.php 文件并写入以下内容:
<pre class="wp-block-syntaxhighlighter-code">

<?php

function get_db_config()
{
    if (getenv('IS_IN_HEROKU')) {
        $url = parse_url(getenv("DATABASE_URL"));

        return $db_config = [
            'connection' => 'pgsql',
            'host' => $url["host"],
            'database'  => substr($url["path"], 1),
            'username'  => $url["user"],
            'password'  => $url["pass"],
        ];
    } else {
        return $db_config = [
            'connection' => env('DB_CONNECTION', 'mysql'),
            'host' => env('DB_HOST', 'localhost'),
            'database'  => env('DB_DATABASE', 'forge'),
            'username'  => env('DB_USERNAME', 'forge'),
            'password'  => env('DB_PASSWORD', ''),
        ];
    }
}

</pre>
29、新增 helpers.php 文件之后,还需要在项目根目录下 composer.json 文件中的 autoload 选项里 files 字段加入该文件。如图25
新增 helpers.php 文件之后,还需要在项目根目录下 composer.json 文件中的 autoload 选项里 files 字段加入该文件。

图25



    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        },
        "files": [
            "app/helpers.php"
        ]
    },


30、修改保存后运行以下命令进行重新加载文件即可,如果有可能影响到本地环境的程序运行,建议在 Sail 环境中执行相应命令。如图26
修改保存后运行以下命令进行重新加载文件即可,如果有可能影响到本地环境的程序运行,建议在 Sail 环境中执行相应命令。

图26



wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ sail composer dump-autoload
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel/sail
Discovered Package: laravel/sanctum
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: overtrue/laravel-lang
Package manifest generated successfully.
Generated optimized autoload files containing 5027 classes
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$


31、现在,让我们使用刚刚定义好的 get_db_config 方法对数据库进行配置。调整数据库配置文件,总计就 2 处改动。如图28
现在,让我们使用刚刚定义好的 get_db_config 方法对数据库进行配置。调整数据库配置文件,总计就 2 处改动。

图28

<pre class="wp-block-syntaxhighlighter-code">

<?php

use Illuminate\Support\Str;

$db_config = get_db_config();

return [

    /*
    |--------------------------------------------------------------------------
    | Default Database Connection Name
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the database connections below you wish
    | to use as your default connection for all database work. Of course
    | you may use many connections at once using the Database library.
    |
    */

    'default' => $db_config['connection'],

</pre>
32、改动的代码进行提交,并推送到 GitHub 和 Heroku 上。


wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ git push
Enumerating objects: 12, done.
Counting objects: 100% (12/12), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 936 bytes | 58.00 KiB/s, done.
Total 7 (delta 5), reused 0 (delta 0)
remote: Resolving deltas: 100% (5/5), completed with 5 local objects.
To https://github.com/shuijingwan/weibo.git
   876eb29..173fc8d  sign-up -> sign-up
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ git merge sign-up
Merge made by the 'recursive' strategy.
 app/helpers.php     | 24 ++++++++++++++++++++++++
 composer.json       |  5 ++++-
 config/database.php |  4 +++-
 3 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100644 app/helpers.php
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 300 bytes | 33.00 KiB/s, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/shuijingwan/weibo.git
   cd4e270..1e23962  main -> main
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$




PS E:\wwwroot\weibo> git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
PS E:\wwwroot\weibo> git push heroku main
Enumerating objects: 19, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 4 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 1.13 KiB | 576.00 KiB/s, done.
Total 9 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/php
remote: -----> PHP app detected
remote: -----> Bootstrapping...
remote: -----> Installing platform packages...
remote:        - php (8.1.1)
remote:        - ext-mbstring (bundled with php)
remote:        - composer (2.1.14)
remote:        - apache (2.4.51)
remote:        - nginx (1.20.2)
remote: -----> Installing dependencies...
remote:        Composer version 2.1.14 2021-11-30 10:51:43
remote:        Installing dependencies from lock file
remote:        Verifying lock file contents can be installed on current platform.
remote:        Package operations: 72 installs, 0 updates, 0 removals
remote:          - Installing doctrine/inflector (2.0.4): Extracting archive
remote:          - Installing doctrine/lexer (1.2.1): Extracting archive
remote:          - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
remote:          - Installing webmozart/assert (1.10.0): Extracting archive
remote:          - Installing dragonmantank/cron-expression (v3.1.0): Extracting archive
remote:          - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
remote:          - Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
remote:          - Installing symfony/deprecation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/http-foundation (v5.4.1): Extracting archive
remote:          - Installing psr/event-dispatcher (1.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/event-dispatcher (v6.0.1): Extracting archive
remote:          - Installing symfony/var-dumper (v5.4.1): Extracting archive
remote:          - Installing psr/log (2.0.0): Extracting archive
remote:          - Installing symfony/error-handler (v5.4.1): Extracting archive
remote:          - Installing symfony/http-kernel (v5.4.1): Extracting archive
remote:          - Installing voku/portable-ascii (1.5.6): Extracting archive
remote:          - Installing phpoption/phpoption (1.8.1): Extracting archive
remote:          - Installing graham-campbell/result-type (v1.0.4): Extracting archive
remote:          - Installing vlucas/phpdotenv (v5.4.1): Extracting archive
remote:          - Installing symfony/css-selector (v6.0.1): Extracting archive
remote:          - Installing tijsverkoyen/css-to-inline-styles (2.2.4): Extracting archive
remote:          - Installing symfony/routing (v5.4.0): Extracting archive
remote:          - Installing symfony/process (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-php72 (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-idn (v1.23.0): Extracting archive
remote:          - Installing symfony/mime (v5.4.0): Extracting archive
remote:          - Installing symfony/finder (v5.4.0): Extracting archive
remote:          - Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive
remote:          - Installing symfony/string (v6.0.1): Extracting archive
remote:          - Installing psr/container (1.1.2): Extracting archive
remote:          - Installing symfony/service-contracts (v2.4.1): Extracting archive
remote:          - Installing symfony/console (v5.4.1): Extracting archive
remote:          - Installing symfony/polyfill-iconv (v1.23.0): Extracting archive
remote:          - Installing egulias/email-validator (2.1.25): Extracting archive
remote:          - Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
remote:          - Installing symfony/polyfill-php81 (v1.23.0): Extracting archive
remote:          - Installing ramsey/collection (1.2.2): Extracting archive
remote:          - Installing brick/math (0.9.3): Extracting archive
remote:          - Installing ramsey/uuid (4.2.3): Extracting archive
remote:          - Installing psr/simple-cache (1.0.1): Extracting archive
remote:          - Installing opis/closure (3.6.2): Extracting archive
remote:          - Installing symfony/translation-contracts (v3.0.0): Extracting archive
remote:          - Installing symfony/translation (v6.0.1): Extracting archive
remote:          - Installing nesbot/carbon (2.55.2): Extracting archive
remote:          - Installing monolog/monolog (2.3.5): Extracting archive
remote:          - Installing league/mime-type-detection (1.9.0): Extracting archive
remote:          - Installing league/flysystem (1.1.9): Extracting archive
remote:          - Installing nette/utils (v3.2.6): Extracting archive
remote:          - Installing nette/schema (v1.2.2): Extracting archive
remote:          - Installing dflydev/dot-access-data (v3.0.1): Extracting archive
remote:          - Installing league/config (v1.1.1): Extracting archive
remote:          - Installing league/commonmark (2.1.0): Extracting archive
remote:          - Installing laravel/serializable-closure (v1.0.5): Extracting archive
remote:          - Installing laravel/framework (v8.76.2): Extracting archive
remote:          - Installing asm89/stack-cors (v2.0.3): Extracting archive
remote:          - Installing fruitcake/laravel-cors (v2.0.4): Extracting archive
remote:          - Installing psr/http-message (1.0.1): Extracting archive
remote:          - Installing psr/http-client (1.0.1): Extracting archive
remote:          - Installing ralouphie/getallheaders (3.0.3): Extracting archive
remote:          - Installing psr/http-factory (1.0.1): Extracting archive
remote:          - Installing guzzlehttp/psr7 (2.1.0): Extracting archive
remote:          - Installing guzzlehttp/promises (1.5.1): Extracting archive
remote:          - Installing guzzlehttp/guzzle (7.4.1): Extracting archive
remote:          - Installing laravel/sanctum (v2.13.0): Extracting archive
remote:          - Installing nikic/php-parser (v4.13.2): Extracting archive
remote:          - Installing psy/psysh (v0.10.12): Extracting archive
remote:          - Installing laravel/tinker (v2.6.3): Extracting archive
remote:          - Installing laravel-lang/lang (5.0.0): Extracting archive
remote:          - Installing overtrue/laravel-lang (4.2.2): Extracting archive
remote:        Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
remote:        Generating optimized autoload files
remote:        > Illuminate\Foundation\ComposerScripts::postAutoloadDump
remote:        > @php artisan package:discover --ansi
remote:        Discovered Package: fruitcake/laravel-cors
remote:        Discovered Package: laravel/sanctum
remote:        Discovered Package: laravel/tinker
remote:        Discovered Package: nesbot/carbon
remote:        Discovered Package: overtrue/laravel-lang
remote:        Package manifest generated successfully.
remote:        50 packages you are using are looking for funding.
remote:        Use the `composer fund` command to find out more!
remote: -----> Preparing runtime environment...
remote: -----> Checking for additional extensions to install...
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 19.9M
remote: -----> Launching...
remote:        Released v10
remote:        https://secret-stream-72395.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/secret-stream-72395.git
   cd4e270..1e23962  main -> main
PS E:\wwwroot\weibo>


33、我们可以使用 heroku run 在 Heroku 运行 Laravel 的指定命令。现在我们需要在 Heroku 上执行迁移,生成用户表,可通过下面命令来完成,报错:SQLSTATE[22023]: Invalid parameter value: 7 ERROR: invalid value for parameter “client_encoding”: “utf8mb4” 。如图28
我们可以使用 heroku run 在 Heroku 运行 Laravel 的指定命令。现在我们需要在 Heroku 上执行迁移,生成用户表,可通过下面命令来完成,报错:SQLSTATE[22023]: Invalid parameter value: 7 ERROR: invalid value for parameter "client_encoding": "utf8mb4" 。

图28

 


PS E:\wwwroot\weibo> heroku run php artisan migrate
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Running php artisan migrate on ⬢ secret-stream-72395... up, run.1841 (Free)
**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes


In Connection.php line 703:

  SQLSTATE[22023]: Invalid parameter value: 7 ERROR:  invalid value for parameter "client_encoding": "utf8mb4" (SQL:
  select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'B
  ASE TABLE')


In PostgresConnector.php line 68:

  SQLSTATE[22023]: Invalid parameter value: 7 ERROR:  invalid value for parameter "client_encoding": "utf8mb4"


PS E:\wwwroot\weibo>


34、再次调整数据库配置文件,之前 pgsql 相关的配置未修改到。


        'pgsql' => [
            'driver' => 'pgsql',
            'host' => $db_config['host'],
            'port' => env('DB_PORT', '5432'),
            'database' => $db_config['database'],
            'username' => $db_config['username'],
            'password' => $db_config['password'],
            'charset' => 'utf8',
            'prefix' => '',
            'prefix_indexes' => true,
            'schema' => 'public',
            'sslmode' => 'prefer',
        ],


35、执行命令:heroku config:add DB_CONNECTION=pgsql 。再次执行迁移时报错已经不一样了:


 »   Warning: heroku update available from 7.53.0 to 7.59.2.
DB_CONNECTION: pgsql
PS E:\wwwroot\weibo> heroku run php artisan migrate
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Running php artisan migrate on ⬢ secret-stream-72395... up, run.7170 (Free)
**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes


In Connection.php line 703:

  SQLSTATE[08006] [7] connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections? (SQL: select * from information_schema.tables
   where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')


In Connector.php line 70:

  SQLSTATE[08006] [7] connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?


PS E:\wwwroot\weibo> git push heroku main
Everything up-to-date
PS E:\wwwroot\weibo> heroku run php artisan migrate
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Running php artisan migrate on ⬢ secret-stream-72395... up, run.6564 (Free)
**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes


In Connection.php line 703:

  SQLSTATE[08006] [7] connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections? (SQL: select * from information_schema.tables
   where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')


In Connector.php line 70:

  SQLSTATE[08006] [7] connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?


PS E:\wwwroot\weibo>


36、最后找到根源在于漏掉了在 Heroku 新增一个 IS_IN_HEROKU 配置项来判断应用是否运行在 Heroku 上。迁移成功。如图29
最后找到根源在于漏掉了在 Heroku 新增一个 IS_IN_HEROKU 配置项来判断应用是否运行在 Heroku 上。迁移成功。

图29



PS E:\wwwroot\weibo> heroku config:set IS_IN_HEROKU=true
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Setting IS_IN_HEROKU and restarting ⬢ secret-stream-72395... done, v16
IS_IN_HEROKU: true
PS E:\wwwroot\weibo> heroku run php artisan migrate
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Running php artisan migrate on ⬢ secret-stream-72395... up, run.3491 (Free)
**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes

Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table (850.26ms)
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table (466.16ms)
Migrating: 2019_08_19_000000_create_failed_jobs_table
Migrated:  2019_08_19_000000_create_failed_jobs_table (902.11ms)
Migrating: 2019_12_14_000001_create_personal_access_tokens_table
Migrated:  2019_12_14_000001_create_personal_access_tokens_table (1,079.00ms)
PS E:\wwwroot\weibo>


37、再次提交表单数据,提交成功。如图30
再次提交表单数据,提交成功。

图30

38、使用 heroku rename 来对应用名称进行更改,但要保证更改的名称未被其它人占用。如图31
使用 heroku rename 来对应用名称进行更改,但要保证更改的名称未被其它人占用。

图31



PS E:\wwwroot\weibo> heroku rename app-wangqiang-weibo
 »   Warning: heroku update available from 7.53.0 to 7.59.2.
Renaming secret-stream-72395 to app-wangqiang-weibo... done
https://app-wangqiang-weibo.herokuapp.com/ | https://git.heroku.com/app-wangqiang-weibo.git
 !    Don't forget to update git remotes for all other local checkouts of the app.
Git remote heroku updated
PS E:\wwwroot\weibo>


39、打开:https://app-wangqiang-weibo.herokuapp.com/ ,响应 200。符合预期。如图32
打开:https://app-wangqiang-weibo.herokuapp.com/ ,响应 200。符合预期。

图32

40、打开:https://secret-stream-72395.herokuapp.com/ ,响应 404。There’s nothing here, yet。符合预期。如图33
打开:https://secret-stream-72395.herokuapp.com/ ,响应 404。There's nothing here, yet。符合预期。

图33

]]>
https://www.shuijingwanwq.com/2021/12/29/5622/feed/ 0
在 WSL2 中的 Ubuntu 系统中,执行命令:sudo apt install php7.4-cli,报错:E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-common_7.4.3-4ubuntu2.5_amd64.deb 404 Not Found [IP: 91.189.88.152 80] https://www.shuijingwanwq.com/2021/12/27/5597/ https://www.shuijingwanwq.com/2021/12/27/5597/#respond Mon, 27 Dec 2021 10:07:08 +0000 = 8.0.2]]> https://www.shuijingwanwq.com/?p=5597 浏览量: 111 1、在 WSL2 中的 Ubuntu 系统中,执行命令:sudo apt install php7.4-cli,报错:E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-common_7.4.3-4ubuntu2.5_amd64.deb 404 Not Found [IP: 91.189.88.152 80]。如图1
在 WSL2 中的 Ubuntu 系统中,执行命令:sudo apt install php7.4-cli,报错:E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-common_7.4.3-4ubuntu2.5_amd64.deb  404  Not Found [IP: 91.189.88.152 80]。

图1



wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ php artisan make:controller StaticPagesController

Command 'php' not found, but can be installed with:

sudo apt install php7.4-cli
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ sudo apt install php7.4-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  php-common php7.4-common php7.4-json php7.4-opcache php7.4-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
  php-common php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 2643 kB of archives.
After this operation, 13.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 php-common all 2:75 [11.9 kB]
Ign:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-common amd64 7.4.3-4ubuntu2.5
Ign:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-json amd64 7.4.3-4ubuntu2.5
Ign:4 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-opcache amd64 7.4.3-4ubuntu2.5
Ign:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-readline amd64 7.4.3-4ubuntu2.5
Ign:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-cli amd64 7.4.3-4ubuntu2.5
Err:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-common amd64 7.4.3-4ubuntu2.5
  404  Not Found [IP: 91.189.88.152 80]
Err:3 http://security.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-json amd64 7.4.3-4ubuntu2.5
  404  Not Found [IP: 91.189.88.152 80]
Err:4 http://security.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-opcache amd64 7.4.3-4ubuntu2.5
  404  Not Found [IP: 91.189.88.152 80]
Err:5 http://security.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-readline amd64 7.4.3-4ubuntu2.5
  404  Not Found [IP: 91.189.88.152 80]
Err:6 http://security.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-cli amd64 7.4.3-4ubuntu2.5
  404  Not Found [IP: 91.189.88.152 80]
Fetched 11.9 kB in 5s (2475 B/s)
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-common_7.4.3-4ubuntu2.5_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-json_7.4.3-4ubuntu2.5_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-opcache_7.4.3-4ubuntu2.5_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-readline_7.4.3-4ubuntu2.5_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-cli_7.4.3-4ubuntu2.5_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$


2、基于提示信息,运行 apt-get update。如图2
基于提示信息,运行 apt-get update。

图2



wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1069 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [197 kB]
Get:8 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [9096 B]
Get:9 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [566 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [80.9 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [528 B]
Get:12 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [668 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [112 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [13.0 kB]
Get:15 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [21.9 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [4948 B]
Get:17 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [540 B]
Get:18 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
Get:23 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1400 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [283 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [14.7 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [616 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [88.1 kB]
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [528 B]
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [884 kB]
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [193 kB]
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [19.9 kB]
Get:32 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [24.8 kB]
Get:33 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [6928 B]
Get:34 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [616 B]
Get:35 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [42.0 kB]
Get:36 http://archive.ubuntu.com/ubuntu focal-backports/main Translation-en [10.0 kB]
Get:37 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [864 B]
Get:38 http://archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:39 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [18.9 kB]
Get:40 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [7492 B]
Get:41 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [636 B]
Get:42 http://archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 21.0 MB in 31s (675 kB/s)
Reading package lists... Done
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$


3、再次执行命令:sudo apt install php7.4-cli,未再报错。如图3
再次执行命令:sudo apt install php7.4-cli,未再报错。

图3



Creating config file /etc/php/7.4/mods-available/shmop.ini with new version

Creating config file /etc/php/7.4/mods-available/sockets.ini with new version

Creating config file /etc/php/7.4/mods-available/sysvmsg.ini with new version

Creating config file /etc/php/7.4/mods-available/sysvsem.ini with new version

Creating config file /etc/php/7.4/mods-available/sysvshm.ini with new version

Creating config file /etc/php/7.4/mods-available/tokenizer.ini with new version
Setting up php7.4-readline (7.4.3-4ubuntu2.8) ...

Creating config file /etc/php/7.4/mods-available/readline.ini with new version
Setting up php7.4-opcache (7.4.3-4ubuntu2.8) ...

Creating config file /etc/php/7.4/mods-available/opcache.ini with new version
Setting up php7.4-json (7.4.3-4ubuntu2.8) ...

Creating config file /etc/php/7.4/mods-available/json.ini with new version
Setting up php7.4-cli (7.4.3-4ubuntu2.8) ...
update-alternatives: using /usr/bin/php7.4 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar7.4 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar7.4 to provide /usr/bin/phar.phar (phar.phar) in auto mode

Creating config file /etc/php/7.4/cli/php.ini with new version
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for php7.4-cli (7.4.3-4ubuntu2.8) ...


4、执行命令:php artisan make:controller StaticPagesController。报错:Your Composer dependencies require a PHP version “>= 8.0.2”. You are running 7.4.3.。如图4
执行命令:php artisan make:controller StaticPagesController。报错:Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.3.。

图4



wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ php artisan make:controller StaticPagesController
Composer detected issues in your platform:

Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.3.

PHP Fatal error:  Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.3. in /mnt/e/wwwroot/weibo/vendor/composer/platform_check.php on line 24
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$


5、由于 Docker 容器是基于 Laravel Sail 实现的。调整执行命令:sail artisan make:controller StaticPagesController。 生成控制器成功。如图5
由于 Docker 容器是基于 Laravel Sail 实现的。调整执行命令:sail artisan make:controller StaticPagesController。 生成控制器成功。

图5



wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$ sail artisan make:controller StaticPagesController
Controller created successfully.
wangqiang@DESKTOP-QLPK8QM:/mnt/e/wwwroot/weibo$


]]>
https://www.shuijingwanwq.com/2021/12/27/5597/feed/ 0