Error Pushing To Heroku, Rails3 beta4 - ruby

i'm getting an error when pushing to heroku using rails 3 beta 4. i've
managed to deploy before using it but for some reason i'm getting a
strange error now.
I'm on os x, snow leopard. I've been using rvm with both 1.9.2 preview
and head, i also just reverted back to the system ruby 1.8.7 -p254 but
they all give me the same error:
--------------------------------------------------------------------------- --------------------------------------------------------------------------- --------------------------------------------------------------------------- ---------------------
git push heroku master
Counting objects: 334, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (285/285), done.
Writing objects: 100% (310/310), 48.73 KiB, done.
Total 310 (delta 119), reused 0 (delta 0)
-----> Heroku receiving push
-----> Rails app detected
-----> Gemfile detected, running Bundler
Unresolved dependencies detected; Installing...
.........
.........
INSTALLS/BUNDLES ALL THE GEMS AND EVERYTHING WORKS FINE UNTILL HERE:
.........
.........
Your bundle is complete! Use `bundle show [gemname]` to see where a
bundled gem is installed.
Locking environment
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_input.rb:49:in `initialize': not in gzip format
(Zlib::GzipFile::Error)
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/
tar_input.rb:49:in `new'
.........
.........
MORE STACK TRACE HERE:
.........
.........
error: hooks/pre-receive exited with error code 1
To g...#heroku.com:hostelizer.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '...#heroku.com:hostelizer.git'
--------------------------------------------------------------------------- --------------------------------------------------------------------------- --------------------------------------------------------------------------- ---------------------
Any ideas would be gr8 as i'm not a guru with ruby/rails.
Cheers.

Related

ruby how to create gemfile / gemfile.lock

I am hobbyist coder. I created a twitch chat bot and now am trying deploy it Heroku. I wrote this code with ruby without rails and I don't have any gemfile or etc. its works fine on my machine but I don't know how to create for Heroku
I tried like that and I had this error:
Enumerating objects: 18, done.
Counting objects: 100% (18/18), done.
Delta compression using up to 16 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (18/18), 4.87 KiB | 997.00 KiB/s, done.
Total 18 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to stormy-refuge-29575.
remote:
To https://git.heroku.com/stormy-refuge-29575.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/stormy-refuge-29575.git'
github link:https://github.com/sydneyfunnelAIO/twitch-bot
All the gems that you are using in your application should be present in the Gemfile. The reason why the app is running on your computer might be that you have those gem installed globally.
Because you are using rufus-scheduler, selenium-webdriver gems, both should be present in the Gemfile, that should look like this:
source 'https://rubygems.org'
gem 'rufus-scheduler'
gem 'selenium-webdriver'
Once your Gemfile exists, run command bundle install that will install the gems and create Gemfile.lock file.
If it's in ruby you just need to do
bundle install

Ruby Heroku deployment failing: This version of Ruby is not available on Heroku-18. How can I upgrade my ruby version and make the deployment succeed?

What is the most efficient way of upgrading Ruby on Mac OS High Sierra?
I am trying to deploy my simple Ruby app onto Heroku.
I am running the command:
git push heroku master
However, I am getting the following error:
18:11 $ git push heroku master
Counting objects: 97, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (82/82), done.
Writing objects: 100% (97/97), 22.59 KiB | 1.88 MiB/s, done.
Total 97 (delta 8), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to
handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See
https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-
delay 1 --connect-timeout 3 --max-time 30 https://s3-external-
1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.3.3.tgz -s -o - | tar
zxf - ' failed on attempt 1 of 3.
remote: Command: 'set -o pipefail; curl -L --fail --retry 5 --retry-
delay 1 --connect-timeout 3 --max-time 30 https://s3-external-
1.amazonaws.com/heroku-buildpack-ruby/heroku-18/ruby-2.3.3.tgz -s -o - | tar
zxf - ' failed on attempt 2 of 3.
remote:
remote: !
remote: ! An error occurred while installing ruby-2.3.3
remote: !
remote: ! This version of Ruby is not available on Heroku-18. The
minimum supported version
remote: ! of Ruby on the Heroku-18 stack can found at:
remote: !
remote: ! https://devcenter.heroku.com/articles/ruby-support#supported-
runtimes
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to morning-plains-67699.
remote:
To https://git.heroku.com/morning-plains-67699.git
! [remote rejected] master -> master (pre-receivehook declined)
error: failed to push some refs to 'https://git.heroku.com/morning-plains-
67699.git'
Heroku doesn't support Ruby 2.3.3
Heroku supports the following Ruby versions and the associated Rubygems. A supported version means that you can expect our tools and platform to work with a given version. It also means you can receive technical support. Here are our supported Ruby versions:
MRI:
2.4.5 : patchlevel 335, Rubygems: 2.6.14.3
2.5.3: patchlevel 105, Rubygems: 2.7.6
2.6.0: patchlevel 0, Rubygems: 3.0.1
Read at Heroku
Also read information how to specify Ruby version.
Check the latest version of ruby in this link https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
then run the latest one rvm install ruby-2.4.6
type ruby -v in the terminal, you should see ruby 2.4.6.
If it still shows you ruby 2.0., run rvm use ruby-2.4.6 --default.
Change the ruby version in your gem file then bundle
This solve my problem
I had the same or similar error. In my case I did check the branches of the remote , git remote show heroku.
I had a branch main , but no a master , so I made a git checkout
git checkout -b main
And then
git push heroku main
Everything was resolved.

Heroku rejecting my app all of a sudden (env: bundle: No such file or directory)

I tried deploying my application today and my deployments are for the first time being rejected.
My deployment output is below. I've tried the following with no change in outcome:
Deploying with no Ruby version in Gemfile
Deploying with 2.1.0 in Gemfile
Deploying using a custom BUILDPACK_URL at https://github.com/heroku/heroku-buildpack-ruby.git
Deploying from a different branch
Deploying from a teammate's machine
Rolling back to last successfully deployed commit, changing a line in the README, committed and redeployed.
I had successfully deployed just last night. I only have made HTML and CSS changes to the new code I want to commit, so nothing in the app settings has been changed since the last successful deployment.
Why would Heroku be now rejecting my app deployments?
Thanks!
Fetching repository, done.
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 496 bytes, done.
Total 6 (delta 5), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.5.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
env: bundle: No such file or directory
Bundler Output: env: bundle: No such file or directory
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:myapp.git
! [remote rejected] development -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:myapp.git'
Heroku dropped support for Rails 1.9 and that was in the PATH. I had some trouble dropping the PATH because heroku had some hack where it was configured, but would not drop (probably because it was a default).
So I ended up setting the PATH to something
heroku config:set PATH=blah
and then unsetting it.
heroku config:remove PATH
That seems to have stuck.

No such file to load -- json (LoadError)

Everything was working fine on this app, and now today I get this when I try to push to Heroku:
Counting objects: 28, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (22/22), 2.20 KiB, done.
Total 22 (delta 14), reused 0 (delta 0)
/app/slug-compiler/lib/slug.rb:12:in `require': no such file to load -- json (LoadError)
from /app/slug-compiler/lib/slug.rb:12
from /app/slug-compiler/bin/slugc:14:in `require'
from /app/slug-compiler/bin/slugc:14
To git#heroku.com:cold-night-9597.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:server-name-1234.git'
Very strange - couldn't find anything on this error anywhere - and its running fine locally...
Try this:
require 'rubygems'
require 'json'
See this answer for details.
I had the same error while running project managed via bundle:
bundle exec jekyll build
The following line was missing in Gemfile:
gem "json"

Heroku Push Rejected for Rails 2.3.5

I am trying to push my app up to Heroku, but am getting rejected. Here is the error message I'm getting.
Counting objects: 63, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (56/56), done.
Writing objects: 100% (63/63), 80.06 KiB, done.
Total 63 (delta 10), reused 0 (delta 0)
-----> Heroku receiving push
! Heroku push rejected, no Cedar-supported app detected
To git#heroku.com:agile-shelf-2850.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:agile-shelf-2850.git'
My app is the simple hello world app and I am using the following:
Rails 2.3.5
Ruby 1.8.7
Gems 1.4.2
I've research the site and found others that have this problem but they are using Rails 3. Example: Heroku push rejected, no Cedar-supported app detected
Any ideas? I'm using these older versions as the project i'm trying to integrate into is using these versions so i'm trying to stay consistent.
You need to move your config.gem lines in your config/environment.rb to a Gemfile and install bundler. Rails 2.x does not have inherent support of Bundler and Cedar requires that you use Bundler to specify your app's gem dependencies. Otherwise it will not see your app as a Rails app.
Install Bundler for Rails 2.3 via:
http://gembundler.com/v1.3/rails23.html
If you have further problems afterwards let us know!

Resources