git push heroku master将无法识别我的Gemfile.lock文件

时间:2012-10-14 20:07:05

标签: ruby-on-rails git heroku push gemfile

我第一次使用Git推送到Heroku,我收到错误消息:Gemfile.lock is required. Please run "bundle install" locally and commit your Gemfile.lock.

我已经运行bundle install,将文件添加到git repo,提交更改。请参阅存储库和我的目录中的Gemfile.lock,但是当我运行命令git push heroku master时,它会一直抛出该错误。

我做错了什么:

这是我电脑上的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状态。

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

尝试部署时出错。

$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

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

1 个答案:

答案 0 :(得分:3)

你可能会犯下错误的分支吗?你正在推动主人并提交给ch_ruby_intro。