2

I'm trying to push rails application that shows just "hello, world.".
Then I met an error like below.
I would like to know how to solve this problem.

$git push heroku master
Enumerating objects: 88, done.
Counting objects: 100% (88/88), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (73/73), done.
Writing objects: 100% (88/88), 22.29 KiB | 1.71 MiB/s, done.
Total 88 (delta 2), reused 0 (delta 0)
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 Bad Request
fatal: The remote end hung up unexpectedly
Everything up-to-date

My procedures are below.
1.create rails application like below.
rails new sample
2.fix routes and application_controller to show hello, world. 3.change Gemfile.
3-1.declare sqlite3 in development and test group gem 'sqlite3'
3-2.declare pg in production group gem 'pg', '0.20.0'
4.execute bundle install --without production
5.execute git add .
6.execute git commit -m "initial commit for heroku"
7.confirm if it works by rails s and access to localhost:3000
8.execute heroku login and enter id and password.
9.execute heroku keys:add and the SSH key is created by this operation.
10.execute heroku create
11.execute git push heroku master and then I got the error

Each programs' version is below.
* Rails 5.1.6
* heroku/7.14.1 win32-x64 node-v10.9.0

What is this error and how can I avoid this error?
Please tell me if you need more information.


I added my gem file below.

source 'https://rubygems.org'

# git_source(:github) do |repo_name|
#  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
#  "https://github.com/#{repo_name}.git"
# end

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.6'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

gem 'rails_12factor'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Use sqlite3 as the database for Active Record
  gem 'sqlite3'
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
end

group :production do
  gem 'pg', '0.20.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
esty
  • 31
  • 1
  • 3
  • 1
    This looks like the same issue. Any luck with answers from that question? https://stackoverflow.com/questions/19449800/error-rpc-failed-result-22-http-code-400 – Michael Brawn Sep 03 '18 at 02:15
  • Thank you for your comment. I tried based on the link, but I couldn't... I use git version 2.18.0.windows, do you think I should use lower version of git? – esty Sep 10 '18 at 14:53

3 Answers3

2

In my case, I had to both change the remote URL to use the git: protocol instead of https:, and I also had to create a public key.

To get the current URL:

git remote get-url heroku

Supposing your URL is something like https://git.heroku.com/your-repo-here.git, you should use this command to use the git: protocol:

git remote set-url heroku git@heroku.com:your-repo-here.git

Create public key:

heroku keys:add

Reference links:

Haroldo_OK
  • 6,612
  • 3
  • 43
  • 80
1

Run the following command to increase the buffer to 500MB after navigating to the repository:

git config http.postBuffer 524288000
nourza
  • 2,215
  • 2
  • 16
  • 42
  • Thank you for your response. I did it but I got same error... Do you have some idea? – esty Sep 03 '18 at 15:14
  • Add this gem gem "rails_12factor" then $bundle install then $git add . $git commit -m "add gem" $git push heroku master let me know if this does work! – nourza Sep 03 '18 at 17:45
  • I tried it but the result is same. Is my gem file is wrong? – esty Sep 04 '18 at 15:28
  • heroku keys:add. That's the only reason I know of that could give you permission denied error. $git remote set-url heroku git@heroku.com:testapp.git and then $heroku keys:add seems to solve your problem – nourza Sep 05 '18 at 05:46
  • Thank you for your help. I recreated application and ssh keys, but I couldn't... It might be something wrong in my environment. – esty Sep 05 '18 at 16:18
1

In case it helps anyone, I had this exact same error pushing to Azure. It turned out I'd filled my App Service storage quota. I deleted a bunch of big files and the problem was solved.