首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ruby如何创建gemfile / gemfile.lock

ruby如何创建gemfile / gemfile.lock
EN

Stack Overflow用户
提问于 2019-09-13 02:51:20
回答 2查看 1.1K关注 0票数 0

我是一个业余程序员。我创建了一个twitch聊天机器人,现在正在尝试部署Heroku。我用没有rails的ruby写了这段代码,我没有任何gemfile等,它在我的机器上运行得很好,但我不知道如何为Heroku创建它,我试过这样做,但我得到了这个错误:

代码语言:javascript
复制
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'

github链接:https://github.com/sydneyfunnelAIO/twitch-bot

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-09-13 18:53:53

您在应用程序中使用的所有gem都应该出现在Gemfile中。这个应用程序在你的电脑上运行的原因可能是你已经在全球范围内安装了这些gem。

因为您使用的是rufus-schedulerselenium-webdriver gem,所以这两个gem都应该出现在Gemfile中,因此应该如下所示:

代码语言:javascript
复制
source 'https://rubygems.org'

gem 'rufus-scheduler'
gem 'selenium-webdriver'

一旦Gemfile存在,运行命令bundle install来安装gem并创建Gemfile.lock文件。

票数 1
EN

Stack Overflow用户

发布于 2019-09-13 03:17:48

如果是用ruby写的,你只需要做

代码语言:javascript
复制
bundle install
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57912948

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档