heroku:Gemfile.lock是必需的问题 [英] heroku: Gemfile.lock is required issue

查看:105
本文介绍了heroku:Gemfile.lock是必需的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题:

我试图在heroku上部署我的项目,但运行后

  git push heroku master 

我得到以下内容:

  git push heroku master -f 
计数对象:524,完成。
使用多达2个线程的增量压缩。
压缩对象:100%(498/498),完成。
写作对象:100%(524/524),157.76 KiB,完成。
共计524(德尔塔207),重用62(德尔塔2)
-----> Heroku接收推送
-----> Ruby / Rails应用程序检测到

! Gemfile.lock是必需的。请在本地运行捆绑安装
!并提交你的Gemfile.lock。

! Heroku推送被拒绝,未能编译Ruby / rails应用程序
到git@heroku.com:*****。git
! [remote rejected] master - > master(pre-receive hook refused)
错误:未能将一些文件推送到'git@heroku.com:*****。git'

我为几个运行了 bundle install bundle update 次,我试图从存储库和我的文件系统中删除 Gemfile.lock 。但我仍然收到同样的信息。任何人都可以告诉我我做错了什么?



我尝试推送的分支是从主复制的。

解决方案

几件事


  1. 是否将Gemfile.lock放入git中?如果是的话,是否锁定(意味着更新? - 你做了几次只是双重检查)

  2. 只需在本地执行 bundle install 提示。
  3. 现在将Gemfile.lock

    • git add。或您只能添加Gemfile.lock与此 git add Gemfile.lock

    • git commit -m在此处提交消息

    • git push


c> git push heroku 它应该可以工作。


I have the following issue:

I'm trying to deploy my project on heroku but after i run

git push heroku master

I get the following:

git push heroku master -f
Counting objects: 524, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (498/498), done.
Writing objects: 100% (524/524), 157.76 KiB, done.
Total 524 (delta 207), reused 62 (delta 2)
-----> Heroku receiving push 
-----> Ruby/Rails app detected
!
!     Gemfile.lock is required. Please run "bundle install" locally
!     and commit your Gemfile.lock.
!
!     Heroku push rejected, failed to compile Ruby/rails app
To git@heroku.com:*****.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:*****.git'

I have run bundle install and bundle update for several times, i tried to delete Gemfile.lock from the repository and from my filesystem. But i still get the same message. Can anyone tell me what am i doing wrong?

The branch i'm trying to push is cloned from master.

解决方案

Few things

  1. Did you placed Gemfile.lock in git? if yes, is it lock (means updated? - you did several times just double check)
  2. Just do bundle install on your local prompt.
  3. now place Gemfile.lock
    • git add . or you can add only Gemfile.lock with this git add Gemfile.lock
    • git commit -m "commit message here"
    • git push

Now do git push heroku it should work.

这篇关于heroku:Gemfile.lock是必需的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆