【发布时间】:2021-01-28 16:56:59
【问题描述】:
我正在尝试在 Mac OS 10.15.7 上从 IntelliJ IDEA 2020.3.1 运行以下 Kotlin 脚本。该脚本在终端上运行良好,但是当我点击 IntelliJ 内的“运行”按钮时,出现以下错误:
zsh:权限被拒绝:/Users/*****/scripts/first.main.kts
解决此权限问题的正确方法是什么?
#!/usr/bin/env kotlin
@file:Repository("https://jcenter.bintray.com")
@file:DependsOn("org.http4k:http4k-bom:4.1.1.2")
@file:DependsOn("org.http4k:http4k-core:4.1.1.2")
@file:DependsOn("org.http4k:http4k-client-apache:4.1.1.2")
@file:DependsOn("org.http4k:http4k-server-netty:4.1.1.2")
import org.http4k.client.ApacheClient
import org.http4k.core.Method
import org.http4k.core.Request
val client = ApacheClient()
val request = Request(Method.GET, "https://api.kanye.rest/").query("format", "text")
println(client(request))
【问题讨论】:
标签: kotlin intellij-idea zsh