Ruby newb在这里.
我通过rubyinstaller下载ruby,做了gem install rails,解决了一些缺少的库,最后分叉了我想要处理的ruby项目.
在接触任何东西之前,我看到我的Gemfile.lock被修改了:
diff --git a/Gemfile.lock b/Gemfile.lock
index aefda68..9ebccba 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -46,6 +46,7 @@ GEM
diff-lcs (1.1.3)
erubis (2.7.0)
eventmachine (1.0.0)
+ eventmachine (1.0.0-x86-mingw32)
execjs (1.4.0)
multi_json (~> 1.0)
hike (1.2.1)
@@ -65,11 +66,17 @@ GEM
multi_json (1.3.6)
multi_xml (0.2.2)
pg (0.14.1)
+ pg (0.14.1-x86-mingw32)
polyglot (0.3.3)
...
PLATFORMS
ruby
+ x86-mingw32
Run Code Online (Sandbox Code Playgroud)
所有修改后的行似乎都与Windows相关.这个答案似乎表明我不应该gitignore Gemfile.lock(它已经承诺了我克隆的repo无论如何).这个答案意味着如果我提交并将其推送到heroku,我可能会遇到错误(这是有道理的,因为我不希望我的应用程序依赖于Windows特定的文件).
那么,这是什么?我该如何解决?我应该从我的仓库中删除Gemfile.lock吗?
我对整个部署工作都很陌生.在我第一次创建应用程序之前,我已经部署了一次我的应用程序,然后一切似乎都运行正常.我现在对我的应用程序进行了一些更改,我想部署它们并确保它们在生产环境中工作.我添加并提交了我的最后一项更改,并将我的更改合并到我的主分支中.然后我跑了git push heroku master.我在输出中收到以下错误:
Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
Run Code Online (Sandbox Code Playgroud)
好的,所以我需要更新我的gemfile.首先,我检查了我的.gitignore文件的内容,它们是:
.bundle
db/*.sqlite3*
log/*.log
*.log
/tmp/
doc/
*.swp
*~
.project
.DS_Store
.psd
Run Code Online (Sandbox Code Playgroud)
Gemfile.lock 好像不在那里,但我还是尝试了以下方法:
git add .
git commit -m "updated Gemfile.lock"
Run Code Online (Sandbox Code Playgroud)
然后我再次推到Heroku并得到了同样的错误.接下来,我试过:
git add Gemfile Gemfile.lock
git commit -m "updated Gemfile.lock (again)"
Run Code Online (Sandbox Code Playgroud)
推后,我得到了同样的结果.搜索了一会儿之后,我找到了这篇文章,这促使我尝试以下方法:
gem update bundler
bundle update …Run Code Online (Sandbox Code Playgroud)