我是业余编码员。我创建了一个 twitch 聊天机器人,现在正在尝试将其部署到 Heroku。我用没有 Rails 的 ruby 编写了这段代码,我没有任何 gemfile 等。它在我的机器上工作正常,但我不知道如何为 Heroku 创建,我尝试了这样的操作,但遇到了这个错误:
Enumerating objects: 18, done.
Counting objects: 100% (18/18), done.
Delta compression using up to 16 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (18/18), 4.87 KiB | 997.00 KiB/s, done.
Total 18 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote:  !     Push failed
remote: Verifying deploy... …Run Code Online (Sandbox Code Playgroud) 我在这里尝试检测数组的哪一部分具有“值”
select方法看起来像:
  a = content.select { |n| n == "a value" }
Run Code Online (Sandbox Code Playgroud)
我试图让它计算位置:
  a = content.select { |n| n == "a value" }
      b = n + 1
Run Code Online (Sandbox Code Playgroud)
当我尝试使用n变量进行选择。我有:
undefined local variable or method `n'
Run Code Online (Sandbox Code Playgroud)