trying to deploy app to heroku recieving error everytime - ruby

i am currently trying to deploy an app to heroku
https://github.com/Shopify/dashing/wiki/How-to%3A-Deploy-to-Heroku
I am following these instructions exactly
bundle install
git init
git add .
git commit -m "My beautiful dashboard"
heroku apps:create myapp
git push heroku master
and receive this error everytime
git push heroku master
Counting objects: 441, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (225/225), done.
Writing objects: 100% (441/441), 503.88 KiB | 445 KiB/s, done.
Total 441 (delta 170), reused 441 (delta 170)
-----> Heroku receiving push
-----> Ruby app detected
!
! Gemfile.lock is required. Please run "bundle install" locally
! and commit your Gemfile.lock.
!
! Heroku push rejected, failed to compile Ruby app

you don't have a Gemfile.lock file
try
bundle install and then git commit -am "message you wanna put here"
as mentioned below, check the gitignore and remove /Gemfile.lock and the commit again may resolve your problem

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

Gemfile.lock required. Please check it in

Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (11/11), 3.82 KiB | 1.91 MiB/s, done.
Total 11 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/NoLockfile
remote:
remote: !
remote: ! Gemfile.lock required. Please check it in.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to aqueous-reaches-83684.
remote:
To https://git.heroku.com/aqueous-reaches-83684.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/aqueous-reaches-83684.git'
I want to launch my application on heroku
I always have one and the same mistake:
Gemfile.lock required. Please check it in.
I did everything according to the instructions! Deleted, downloaded, does not work anyway
Used
bundle install
Still the same error
Make sure you add your Gemfile.lock to source control.
Considering you are on master branch:
git add Gemfile.lock
git commit -m "Commit Gemfile.lock"
git push heroku master
Otherwise:
git push heroku current_branch:master
If it doesn't work, you probably have it ignored in your .gitignore file.
Remove Gemfile.lock or *.lock from your ignored list and repeat the commands above.

Git can't find set buildpack

So I am learning how to use git with Heroku and I can't seem to git push my set repo. So I set the buildpack to ruby with Heroku as ruby by doing so..
root#slacker:~/ruby# heroku buildpacks:set heroku/ruby
Buildpack set. Next release on stormy-earth-98069 will use heroku/ruby.
Run git push heroku master to create a new release using this buildpack.
Next I try to update my repo using git push and I get an error saying this..
root#slacker:~/ruby# git push heroku master
...
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
...
So I am wondering what could cause git to do this?
Your question has the answer. According docs, looks like the directory from where you are running 'git push' doesn't have Gemfile.

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.

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