我是一个业余程序员。我创建了一个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...
remote:
remote: ! Push rejected to stormy-refuge-29575.
remote:
To https://git.heroku.com/stormy-refuge-29575.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/stormy-refuge-29575.git'发布于 2019-09-13 18:53:53
您在应用程序中使用的所有gem都应该出现在Gemfile中。这个应用程序在你的电脑上运行的原因可能是你已经在全球范围内安装了这些gem。
因为您使用的是rufus-scheduler和selenium-webdriver gem,所以这两个gem都应该出现在Gemfile中,因此应该如下所示:
source 'https://rubygems.org'
gem 'rufus-scheduler'
gem 'selenium-webdriver'一旦Gemfile存在,运行命令bundle install来安装gem并创建Gemfile.lock文件。
发布于 2019-09-13 03:17:48
如果是用ruby写的,你只需要做
bundle installhttps://stackoverflow.com/questions/57912948
复制相似问题