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

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

问题描述

我有以下问题:

我正在尝试在 heroku 上部署我的项目,但在我运行之后

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

git push heroku master

我得到以下信息:

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'

我已经多次运行 bundle installbundle update,我试图从存储库和我的文件系统中删除 Gemfile.lock.但我仍然收到相同的消息.谁能告诉我我做错了什么?

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?

我尝试推送的分支是从 master 克隆的.

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

推荐答案

一些事情

  1. 你是否在 git 中放置了 Gemfile.lock?如果是,它是否锁定(意味着更新? - 你做了几次只是仔细检查)
  2. 只需在本地提示下执行 bundle install.
  3. 现在放置 Gemfile.lock
    • git add . 或者你可以只用这个 git add Gemfile.lock
    • 添加 Gemfile.lock
    • git commit -m "在此处提交消息"
    • git push
  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

现在执行 git push heroku 它应该可以工作了.

Now do git push heroku it should work.

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

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