git push heroku master不会识别我的Gemfile.lock文件 [英] git push heroku master will not recognize my Gemfile.lock file

查看:157
本文介绍了git push heroku master不会识别我的Gemfile.lock文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次使用Git推到Heroku,我得到错误消息: Gemfile.lock是必需的。请在本地运行bundle install并提交您的Gemfile.lock。



我已经运行 bundle install ,将这些文件添加到 git 回购库中,提交更改。在存储库和我的目录中都可以看到 Gemfile.lock ,但是当我运行命令 git push heroku master 抛出错误。



我在做什么错:



这是我的PC上的git repo



  $ git ls-files 
.bundle / config
.gitignore
.rspec
Gemfile
Gemfile.lock
README
Rakefile
app / assets / images / rails.png
app / assets / javascripts / application.js
app /assets/stylesheets/application.css
..< snip> ..

此处

  $ git status 
#在分支上ch_ruby_intro
#您的分支在6次提交之前领先于'origin / ch_ruby_intro'。
$
没有提交(工作目录干净)

  $ git push heroku master 
计数对象:239,完成。
压缩对象:100%(140/140),完成。
写作对象:100%(239/239),50.30 KiB,完成。
共计239(增量74),重用215(增量67)

-----> Heroku接收推送
-----> Ruby / Rails应用程序检测到

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

!为什么没有看到Gemfile.lock文件?

解决方案

可能是因为你犯了错误的分支?你在推动主人并致力于ch_ruby_intro。


My first time pushing to Heroku using Git and I'm getting the error message: Gemfile.lock is required. Please run "bundle install" locally and commit your Gemfile.lock.

I have ran bundle install, added the files to the git repo, commited the changes. See the Gemfile.lock in both the repository and my directory but when I run the command git push heroku master it consistently throws that error.

What am I doing wrong:

Here is the git repo on my PC

$git ls-files
.bundle/config
.gitignore
.rspec
Gemfile
Gemfile.lock
README
Rakefile
app/assets/images/rails.png
app/assets/javascripts/application.js
app/assets/stylesheets/application.css
..<snip>..

Here is the git status of the repo.

$git status
# On branch ch_ruby_intro
# Your branch is ahead of 'origin/ch_ruby_intro' by 6 commits.
#
nothing to commit (working directory clean)

Error when I try to deploy.

$git push heroku master
Counting objects: 239, done.
Compressing objects: 100% (140/140), done.
Writing objects: 100% (239/239), 50.30 KiB, done.
Total 239 (delta 74), reused 215 (delta 67)

-----> 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

Why is it not seeing the Gemfile.lock file?

解决方案

Might it be that you're committing to the wrong branch? You're pushing master and committing to ch_ruby_intro.

这篇关于git push heroku master不会识别我的Gemfile.lock文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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