Heroku Push被拒绝了,因为宝石无法安装

发布于 2025-01-29 07:23:01 字数 4614 浏览 3 评论 0原文

在执行

git add。

git Commist -m“ Message -there”

git推动heroku master git commit -m git commit -m git commit -m git commit -m git push heroku master git commit -m git commit -m git commit -m git commit -m git add。 /code>

我会收到以下错误消息:

Enumerating objects: 174, done.

Counting objects: 100% (174/174), done.                                                                                 
Delta compression using up to 12 threads                                                                                
Compressing objects: 100% (156/156), done.                                                                              
Writing objects: 100% (174/174), 38.41 KiB | 2.40 MiB/s, done.                                                          
Total 174 (delta 62), reused 36 (delta 3)                                                                               
remote: Compressing source files... done.                                                                               
remote: Building source:                                                                                                
remote:                                                                                                                 
remote: -----> Building on the Heroku-20 stack                                                                          
remote: -----> Determining which buildpack to use for this app                                                          
remote: -----> Ruby app detected                                                                                        
remote: -----> Installing bundler 2.3.10                                                                                
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock                                                        
remote: -----> Compiling Ruby/Rails                                                                                     
remote: -----> Using Ruby version: ruby-2.6.6                                                                           
remote: -----> Installing dependencies using bundler 2.3.10                                                             
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4                                                                                         
remote:        /usr/bin/env: ‘ruby\r’: No such file or directory                                                        
remote:        Bundler Output: /usr/bin/env: ‘ruby\r’: No such file or directory                                        
remote:                                                                                                                 
remote:  !                                                                                                              
remote:  !     Failed to install gems via Bundler.                                                                      
remote:  !                                                                                                              
remote:  !     Push rejected, failed to compile Ruby app.                                                               
remote:                                                                                                                 
remote:  !     Push failed                                                                                              
remote: Verifying deploy...                                                                                             
remote:                                                                                                                 
remote: !       Push rejected to damp-spire-06287.                                                                      
remote:                                                                                                                 
To https://git.heroku.com/damp-spire-06287.git                                                                           
! [remote rejected] master -> master (pre-receive hook declined)                                                error: failed to push some refs to 'https://git.heroku.com/damp-spire-06287.git

我不确定这是Bundler版本的问题,但如果可能的话,我需要任何帮助。我已经尝试做

bundle install and bundle update

,捆绑包完成了。我已经被困了一段时间,并尝试替换捆绑版本无济于事。提前致谢!

I need some help with this small app I am trying to push to heroku after doing

git add .

git commit -m "message here"

git push heroku master

I get the following error message:

Enumerating objects: 174, done.

Counting objects: 100% (174/174), done.                                                                                 
Delta compression using up to 12 threads                                                                                
Compressing objects: 100% (156/156), done.                                                                              
Writing objects: 100% (174/174), 38.41 KiB | 2.40 MiB/s, done.                                                          
Total 174 (delta 62), reused 36 (delta 3)                                                                               
remote: Compressing source files... done.                                                                               
remote: Building source:                                                                                                
remote:                                                                                                                 
remote: -----> Building on the Heroku-20 stack                                                                          
remote: -----> Determining which buildpack to use for this app                                                          
remote: -----> Ruby app detected                                                                                        
remote: -----> Installing bundler 2.3.10                                                                                
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock                                                        
remote: -----> Compiling Ruby/Rails                                                                                     
remote: -----> Using Ruby version: ruby-2.6.6                                                                           
remote: -----> Installing dependencies using bundler 2.3.10                                                             
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4                                                                                         
remote:        /usr/bin/env: ‘ruby\r’: No such file or directory                                                        
remote:        Bundler Output: /usr/bin/env: ‘ruby\r’: No such file or directory                                        
remote:                                                                                                                 
remote:  !                                                                                                              
remote:  !     Failed to install gems via Bundler.                                                                      
remote:  !                                                                                                              
remote:  !     Push rejected, failed to compile Ruby app.                                                               
remote:                                                                                                                 
remote:  !     Push failed                                                                                              
remote: Verifying deploy...                                                                                             
remote:                                                                                                                 
remote: !       Push rejected to damp-spire-06287.                                                                      
remote:                                                                                                                 
To https://git.heroku.com/damp-spire-06287.git                                                                           
! [remote rejected] master -> master (pre-receive hook declined)                                                error: failed to push some refs to 'https://git.heroku.com/damp-spire-06287.git

I am not sure if it is an issue with the bundler version or something else but I need any help if possible. I have tried doing

bundle install and bundle update

and the bundle completes without a hitch. I have been stuck for a while and tried replacing the bundle version to no avail. Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老旧海报 2025-02-05 07:23:01

由于您的存储库中的线路结尾不正确(CRLF与LF),因此引起了此错误,这通常是在您跨Windows和Unix型环境中工作/部署时引起的。 Mac/unix/linux环境 - Heroku使用的 - 使用单个lineFeed(通常表示为\ n)字符在Windows使用托架返回/lineFeed Pair(\ r)时终止行\ n)。

如果您的本地存储库在Windows机器上,则需要在推送到Heroku之前将存储库中的文件转换。您可以配置git来处理自动转换,以便在Windows上结帐时具有Windows终结器,但仅使用LineFeeds维护回购。

为了设置自动转换:

% git config --global core.autocrlf input

GIT还提供了一种刷新存储库的方法,以确保所有线路结尾都是正确的。这可能会导致合并头痛,因为这会影响某些/所有文件中的每一行,因此您最好想在完全最新的存储库中执行此操作(即,没有未解决的更改)。

% git add --renormalize .
% git commit -m "Normalize all the line endings"

< //docs.github.com/en/get-started/getting-with-with-git/configuring-git-to-to-to-handle-line-endings

This error is caused because you have incorrect line endings (CRLF vs. LF) in your repo, which is generally caused when you are working/deploying across Windows and Unix-like environments. Mac/Unix/Linux environments -- which Heroku uses -- use a single linefeed (usually denoted \n) character to terminate a line while Windows uses a carriage return/linefeed pair (\r\n).

If your local repo is on a Windows machine you'll need to convert the files in your repo before pushing to Heroku. You can configure Git to handle the auto-conversion so that you have Windows terminators when you checkout on Windows but maintain the repo with just linefeeds.

To set up the automatic conversion:

% git config --global core.autocrlf input

Git also provides a way to refresh your repo to ensure all the line endings are correct. This can cause merge headaches since this can affect every line in some/all files, so you preferably want to do this on a fully up-to-date repo (i.e., no un-pushed changes).

% git add --renormalize .
% git commit -m "Normalize all the line endings"

https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文