ruby how to create gemfile / gemfile.lock - ruby

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

Related

How to Fix Nodejs Heroku Running into Error?

I followed the step to upload my backend to Heroku from this video: https://www.youtube.com/watch?v=rSkxia0ZZQ0, and I got this error:
Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 16 threads
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 3.14 KiB | 1.57 MiB/s, done.
Total 10 (delta 7), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote: 1. https://github.com/timanovsky/subdir-heroku-buildpack.git
remote: 2. heroku/nodejs
remote: -----> Subdir buildpack app detected
remote: PROJECT_PATH is undefined
remote: ! Push rejected, failed to compile Subdir buildpack app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: aad8206689cb2d86d27ef0e2a124aa9701bf8a7b
remote: !
remote: ! We have detected that you have triggered a build from source code with version aad8206689cb2d86d27ef0e2a124aa9701bf8a7b
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to heroku-skiplagged-final.
remote:
To https://git.heroku.com/heroku-skiplagged-final.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/heroku-skiplagged-final.git'
Procfile:
web: node backend/backend.js
Picture of my Folders
Procfile Photo
Package.json Photo
PROJECT_PATH and BuildPacks from Heroku
Video Link with the error above: https://youtu.be/T6eWAdPVOJI
Heroku sees that you made some changes in your visual studio code or what are you using and it's telling you that you didn't push on git the last version of your app.
remote: ! ## Warning - The same version of this code has already been
built: aad8206689cb2d86d27ef0e2a124aa9701bf8a7b remote: ! remote: !
We have detected that you have triggered a build from source code with
version aad8206689cb2d86d27ef0e2a124aa9701bf8a7b
You need to commit your changes in the project and push them to git and after you can push the git on the heroku server.

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.

Pushing meteor to heroku error

I am trying to push a meteor app to heroku and I am getting this error. I am using the this buildpack heroku config:set BUILDPACK_URL=https://github.com/lirbank/meteor-buildpack-horse.git
git push heroku master
Counting objects: 268, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (254/254), done.
Writing objects: 100% (268/268), 3.84 MiB | 388.00 KiB/s, done.
Total 268 (delta 81), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Node.js app detected
remote: -----> Installing node
remote: -----> Installing meteor
remote: Downloading Meteor distribution
remote: ################################# 100.0%
remote: Meteor 1.2.0.2 has been installed in your home directory (~/.meteor).
remote:
remote: Now you need to do one of the following:
remote: (1) Add "$HOME/.meteor" to your path, or
remote: (2) Run this command as root:
remote: cp "/tmp/buildpack_de3e5x8d2f97747we2s5fb78436762066/meteor- fkUa/.meteor/packages/meteor-tool/1.1.9/mt-os.linux.x86_64/scripts/admin/launch- meteor" /usr/bin/meteor
remote: Then to get started, take a look at 'meteor --help' or see the docs at
remote: docs.meteor.com.
remote: -----> Bundling bundle
remote:
remote:
remote: While removing platforms:
remote: error: ios: platform is not in this project
remote: error: android: platform is not in this project
remote:
remote:
remote: ! Push rejected, failed to compile Node.js app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected
I solved the problem. So I installed both ios and android platforms into my meteor app and setup heroku config var to BUILDPACK_PRELAUNCH_METEOR.
Thanks, it worked for me like a charm.
I have a webapp and android app in the same folder.
the exact command line is:
heroku config:set BUILDPACK_PRELAUNCH_METEOR=1

Heroku deploy of Gulp + Compass is not working at boilerplate stage

I am using Gulp boilerplate from here and buildpack from here. Anyway, i just want to deploy clean boilerplate and no such code. I think it should work with just adding buildpack by heroku buildpacks:add ${url}. It doesn't work, giving me that output:
C:\Users\Dawid\Desktop\Harvest>git push heroku master
Counting objects: 541, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (245/245), done.
Writing objects: 100% (541/541), 147.00 KiB | 0 bytes/s, done.
Total 541 (delta 261), reused 532 (delta 260)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Node.js app detected
remote:
remote: PRO TIP: Specify a node version in package.json
remote: See https://devcenter.heroku.com/articles/nodejs-support
remote:
remote: -----> Defaulting to latest stable node: 0.12.3
remote: -----> Downloading and installing node
remote: -----> Exporting config vars to environment
remote: -----> Installing dependencies
remote: npm WARN package.json YourProject#0.0.1 No repository field.
remote: -----> Cleaning up node-gyp and npm artifacts
remote: -----> Procfile not found and npm start script is undefined
remote:
remote: PRO TIP: Create a Procfile or specify a start script in package.j
son
remote: See https://devcenter.heroku.com/articles/nodejs-support
remote:
remote: -----> Installing Sass / Compass / Haml
remote: WARNING: You don't have /tmp/build_a4c003166016ef188ee84e9068b95aec/.ge
m/ruby/2.2.0/bin in your PATH,
remote: gem executables will not run.
remote: Successfully installed sass-3.4.14
remote: 1 gem installed
remote: WARNING: You don't have /tmp/build_a4c003166016ef188ee84e9068b95aec/.ge
m/ruby/2.2.0/bin in your PATH,
remote: gem executables will not run.
remote: Building native extensions. This could take a while...
remote: Successfully installed ffi-1.9.8
remote: Successfully installed rb-inotify-0.9.5
remote: Successfully installed rb-fsevent-0.9.5
remote: Successfully installed chunky_png-1.3.4
remote: Successfully installed sass-3.4.14
remote: Successfully installed compass-import-once-1.0.5
remote: Successfully installed compass-core-1.0.3
remote: Compass is charityware. If you love it, please donate on our behalf
at http://umdf.org/compass Thanks!
remote: Successfully installed compass-1.0.3
remote: 8 gems installed
remote: WARNING: You don't have /tmp/build_a4c003166016ef188ee84e9068b95aec/.ge
m/ruby/2.2.0/bin in your PATH,
remote: gem executables will not run.
remote: Successfully installed tilt-2.0.1
remote:
remote: HEADS UP! Haml 4.0 has many improvements, but also has changes that may
break
remote: your application:
remote:
remote: * Support for Ruby 1.8.6 dropped
remote: * Support for Rails 2 dropped
remote: * Sass filter now always outputs <style> tags
remote: * Data attributes are now hyphenated, not underscored
remote: * html2haml utility moved to the html2haml gem
remote: * Textile and Maruku filters moved to the haml-contrib gem
remote:
remote: For more info see:
remote:
remote: http://rubydoc.info/github/haml/haml/file/CHANGELOG.md
remote:
remote: Successfully installed haml-4.0.6
remote: 2 gems installed
remote: -----> Caching ruby gems directory for future builds
remote: -----> Found Gulpfile
remote: -----> Running gulp heroku: task
remote: /tmp/buildpack_a4c003166016ef188ee84e9068b95aec/bin/compile: line 168: /
tmp/build_a4c003166016ef188ee84e9068b95aec/node_modules/.bin/gulp: No such file
or directory
remote:
remote: ! Push rejected, failed to compile Node.js app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to calm-badlands-5771.
remote:
To https://git.heroku.com/calm-badlands-5771.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/calm-badlands-5771.gi
t'
Your ruby/compass installation on Heroku must be out of date. I had to update mine to 2.2.0 for compass to work but i am using a custom buildpack as well for Grunt-NodeJS-Compass
https://github.com/devakone/heroku-buildpack-nodejs-grunt-compass
You can take a look at the
https://github.com/devakone/heroku-buildpack-nodejs-grunt-compass/blob/master/bin/compile
file
line 153
export GEM_HOME=$build_dir/.gem/ruby/2.2.0
Make sure your GEM_HOME variable points to the ruby 2.2.0 directory.

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