No default language could be detected for this app - ruby-on-rails

I push object to heroku. Run git push heroku master.
It said:
Counting objects: 124, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (113/113), done.
Writing objects: 100% (124/124), 23.86 KiB | 0 bytes/s, done.
Total 124 (delta 29), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to fast-spire-62625.
remote:
I googled that, but I did not find the right way to fix it!

Each language/buildpack has a bin/detect file used to detect if it can be used for that app.
That error indicates no default buildpacks were detected here.
The ruby buildpack relies on the presence of a Gemfile file at the top of your directory.
This error means that file wasn't found. Is this really a ruby project? Is it at the top of your directory or in a subfolder?

You can change the buildpack used by an application by setting the buildpack value. When the application is next pushed, the new buildpack will be used.
heroku buildpacks:set heroku/ruby
Refer this

Related

Heroku deploys failing: Error: Unknown error installing "12.x" of node

Our deploys started failing to heroku yesterday and I can't figure out why, nothing in our codebase changed related to the build/dependencies. I've been trying to debug it and use different combinations of buildpacks for a day now and cant seem to figure it out. Heroku support hasn't been able to help me either.
Essentially it errors out when it goes to install node. Ive tried every version of node and various buildpacks. Prior to the builds failing we werent specifying our versions in the package.json, but I tried doing this with all the different combinations and still no luck. The deploy breaks at this point:
remote: Resolving node version 12.x...
remote: Error: Unknown error installing "12.x" of node
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
Let me know any information I could provide or debugging ideas anyone might have, thanks in advance!
The problem was the QuotaGuard Static IP's Add-On which was prompting us to upgrade, we upgraded and then our deploys started breaking likely because of a cached environment variable on the heroku side for HTTPS_PROXY. I removed this variable and the build worked.

Heroku Push failing Ruby Rails App error while loading shared libraries, file too short

I was trying to push a new version of my rails app to my Heroku account which sits on a Heroku-16 stack but suddenly it began failing with the following error:
[master 195f4f9] ...
1 file changed, 6 insertions(+), 1 deletion(-)
Counting objects: 15, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (15/15), 1.66 KiB | 1.66 MiB/s, done.
Total 15 (delta 11), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/vendor/ruby/heroku-16/bin/ruby: error while loading shared libraries: /app/tmp/buildpacks/f6d48d8a14fccbb19c0c0402fca224929d18e9ee042b3e204bc5992612e990d3b3a0fb1f9627b1a3bae11e9fa20dffc96e136bd734a2f3cf92a0d05bedd42cfe/vendor/ruby/heroku-16/bin/../lib/libruby.so.2.2: file too short
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to myherokuapp.
remote:
To https://git.heroku.com/myherokuapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myherokuapp.git'
I tried doing a bundle update, that did not solve anything. I also tried undoing recent changes to the code and that did not resolve the issue. Finally, I also checked Heroku status and there are no relevant incidents that they have reported. Any idea why this would be occurring?
I found the solution. I upgraded my ruby version in my gemfile to 2.3.7, one of the stated versions that Heroku says it supports and that seemed to resolve the issue.

Can't push to Heroku Push rejected

I'm trying to push changes to my heroku app, but after a while it freezes and errors out. May be related with the fact that I was using puma for webserver but I had to remove because of incompatibility issues with plezi, the framework I'm using from websockets. My app in total is 4mb.
I get this error message:
remote: ! Timed out compiling Ruby app (15 minutes)
remote: ! See https://devcenter.heroku.com/articles/slug-compiler#time-limit
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to my-app-3605.
remote:
To https://git.heroku.com/my-app-3605.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/my-app-3605.git'
The setup I have with plezi, is that it creates a mini app within rails. It creates a folder, in my case appname\ that contains it's own Gemfile, Procfile and appname.rb
|
|-- app\
|-- appname\
|-- bin\
.
. and so on
.
As included in the response, the error is
Timed out compiling Ruby app (15 minutes)
remote: ! See https://devcenter.heroku.com/articles/slug-compiler#time-limit
You may want to check the referenced link and determine why it took more than 15 minutes to deploy the app.
To solve the issue, it was needed to add to Rakefile
require 'plezi/rake'
This will solve Plezi/Rails incompatibility when pushing to Heroku
http://www.plezi.io/docs/rake

How can I get zbar to deploy on Heroku?

I am using the ruby-zbar gem in a rails app to scan barcodes from jpgs. I installed the zbar library using homebrew on my local machine and everything works fine. However, when deploying to Heroku I consistently get errors such as the following:
remote: LoadError: Didn't find libzbar on your system
remote: Please install zbar (http://zbar.sourceforge.net/) or set ZBAR_LIB if it's in a weird place
remote: FFI::Library::ffi_lib() failed with error: library names list must not be empty
I've tried following the advice from this Stack Overflow post (Heroku Zbar Didn't find libzbar on your system (LoadError)), namely to set the ZBAR_LIB ENV variable to /app/vendor/lib/libzbar.so, or failing that to run heroku bash and try to find a file named libzbar.so and point ZBAR_LIB to its path.
However, I can't seem to find the heroku buildpack referenced in the original Stack Overflow post (the link to https://github.com/ballantyne/heroku-buildpack-zbar goes to a 404 page), so I can't replicate the solution outlined there.
I have tried all of the following buildpacks:
https://github.com/generalui/heroku-buildpack-zbar
https://github.com/robert-wallis/heroku-buildpack-zbar
https://github.com/robert-wallis/heroku-buildpack-zbar/tree/patch-1
During the build process I can see hopeful messages like this:
remote: -----> Multipack app detected
remote: -----> Fetching custom git buildpack... done
remote: -----> ZBAR app detected
remote: -----> Downloading and installing ZBAR
remote: -----> Configuring ZBAR
remote: -----> Make!
remote: -----> Make install !!!
remote: -----> Writing profile script
remote: -----> Fetching custom git buildpack... done
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.1
But setting ZBAR_LIB to /app/vendor/lib/libzbar.so gives me some version of this error:
remote: LoadError: Didn't find libzbar on your system
remote: Please install zbar (http://zbar.sourceforge.net/) or set ZBAR_LIB if it's in a weird place
remote: FFI::Library::ffi_lib() failed with error: Could not open library '/app/vendor/lib/libzbar.so': /app/vendor/lib/libzbar.so: cannot open shared object file: No such file or directory
And trying to find libzbar.so on heroku run bash has not been successful for me -- I can see many files that are similar in name (even a libzbar.rc) but none that fits the bill.
~ $ find / -name '*libzbar*'
find: `/var/lib/polkit-1': Permission denied
/app/vendor/zbar/plugin/.deps/plugin_libzbarplugin_la-plugin.Plo
/app/vendor/zbar/qt/.deps/qt_libzbarqt_la-QZBar.Plo
/app/vendor/zbar/qt/.deps/qt_libzbarqt_la-QZBarThread.Plo
/app/vendor/zbar/qt/.deps/qt_libzbarqt_la-moc_QZBarThread.Plo
/app/vendor/zbar/qt/.deps/qt_libzbarqt_la-moc_QZBar.Plo
/app/vendor/zbar/gtk/.deps/gtk_libzbargtk_la-zbargtk.Plo
/app/vendor/zbar/gtk/.deps/gtk_libzbargtk_la-zbarmarshal.Plo
/app/vendor/zbar/zbar/zbar_libzbar_la-symbol.lo
/app/vendor/zbar/zbar/zbar_libzbar_la-video.o
/app/vendor/zbar/zbar/zbar_libzbar_la-error.lo
/app/vendor/zbar/zbar/processor/zbar_libzbar_la-lock.lo
/app/vendor/zbar/zbar/processor/.libs/zbar_libzbar_la-lock.o
/app/vendor/zbar/zbar/processor/zbar_libzbar_la-lock.o
/app/vendor/zbar/zbar/processor/.deps/zbar_libzbar_la-null.Plo
/app/vendor/zbar/zbar/processor/.deps/zbar_libzbar_la-x.Plo
/app/vendor/zbar/zbar/processor/.deps/zbar_libzbar_la-posix.Plo
/app/vendor/zbar/zbar/processor/.deps/zbar_libzbar_la-lock.Plo
/app/vendor/zbar/zbar/processor/.deps/zbar_libzbar_la-win.Plo
/app/vendor/zbar/zbar/zbar_libzbar_la-config.o
/app/vendor/zbar/zbar/zbar_libzbar_la-processor.o
/app/vendor/zbar/zbar/zbar_libzbar_la-refcnt.lo
/app/vendor/zbar/zbar/zbar_libzbar_la-convert.o
/app/vendor/zbar/zbar/zbar_libzbar_la-video.lo
/app/vendor/zbar/zbar/zbar_libzbar_la-window.o
/app/vendor/zbar/zbar/video/.deps/zbar_libzbar_la-null.Plo
/app/vendor/zbar/zbar/video/.deps/zbar_libzbar_la-v4l1.Plo
/app/vendor/zbar/zbar/video/.deps/zbar_libzbar_la-v4l2.Plo
/app/vendor/zbar/zbar/video/.deps/zbar_libzbar_la-vfw.Plo
/app/vendor/zbar/zbar/zbar_libzbar_la-processor.lo
/app/vendor/zbar/zbar/zbar_libzbar_la-image.lo
/app/vendor/zbar/zbar/zbar_libzbar_la-refcnt.o
/app/vendor/zbar/zbar/zbar_libzbar_la-error.o
/app/vendor/zbar/zbar/qrcode/.deps/zbar_libzbar_la-qrdectxt.Plo
/app/vendor/zbar/zbar/qrcode/.deps/zbar_libzbar_la-binarize.Plo
/app/vendor/zbar/zbar/qrcode/.deps/zbar_libzbar_la-isaac.Plo
/app/vendor/zbar/zbar/qrcode/.deps/zbar_libzbar_la-rs.Plo
/app/vendor/zbar/zbar/qrcode/.deps/zbar_libzbar_la-qrdec.Plo
/app/vendor/zbar/zbar/qrcode/.deps/zbar_libzbar_la-bch15_5.Plo
/app/vendor/zbar/zbar/qrcode/.deps/zbar_libzbar_la-util.Plo
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-video.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-config.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-processor.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-convert.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-window.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-refcnt.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-error.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-img_scanner.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-image.o
/app/vendor/zbar/zbar/.libs/zbar_libzbar_la-symbol.o
/app/vendor/zbar/zbar/zbar_libzbar_la-img_scanner.o
/app/vendor/zbar/zbar/zbar_libzbar_la-image.o
/app/vendor/zbar/zbar/window/.deps/zbar_libzbar_la-null.Plo
/app/vendor/zbar/zbar/window/.deps/zbar_libzbar_la-dib.Plo
/app/vendor/zbar/zbar/window/.deps/zbar_libzbar_la-xv.Plo
/app/vendor/zbar/zbar/window/.deps/zbar_libzbar_la-x.Plo
/app/vendor/zbar/zbar/window/.deps/zbar_libzbar_la-ximage.Plo
/app/vendor/zbar/zbar/window/.deps/zbar_libzbar_la-win.Plo
/app/vendor/zbar/zbar/zbar_libzbar_la-img_scanner.lo
/app/vendor/zbar/zbar/libzbar.rc
/app/vendor/zbar/zbar/zbar_libzbar_la-symbol.o
/app/vendor/zbar/zbar/zbar_libzbar_la-config.lo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-decoder.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-config.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-convert.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-processor.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-symbol.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-scanner.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-error.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-jpeg.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-video.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-window.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-refcnt.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-svg.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-img_scanner.Plo
/app/vendor/zbar/zbar/.deps/zbar_libzbar_la-image.Plo
/app/vendor/zbar/zbar/zbar_libzbar_la-window.lo
/app/vendor/zbar/zbar/decoder/.deps/zbar_libzbar_la-code39.Plo
/app/vendor/zbar/zbar/decoder/.deps/zbar_libzbar_la-pdf417.Plo
/app/vendor/zbar/zbar/decoder/.deps/zbar_libzbar_la-qr_finder.Plo
/app/vendor/zbar/zbar/decoder/.deps/zbar_libzbar_la-i25.Plo
/app/vendor/zbar/zbar/decoder/.deps/zbar_libzbar_la-ean.Plo
/app/vendor/zbar/zbar/decoder/.deps/zbar_libzbar_la-code128.Plo
/app/vendor/zbar/zbar/zbar_libzbar_la-convert.lo
Has anyone had success getting zbar to run on heroku? If so, what buildpack did you use? I would be thrilled to learn how to make this work.
This is what ultimately worked for me:
1) I needed to use the apt-buildpack and the ruby buildpack in tandem.
Command line:
heroku buildpacks
https://github.com/ddollar/heroku-buildpack-apt
https://github.com/heroku/heroku-buildpack-ruby
2) Then I created a file called Aptfile (no extension), placed it at the root of my project folder, and the only line in it is:
Aptfile:
libzbar-dev
Finally, I had to not require zbar in my gemfile, and require it separately in the code where I was processing the barcode:
Gemfile:
gem 'zbar', :require => false
Controller:
class HomeController < ApplicationController
require 'zbar'
def index
path = "#{Rails.public_path}/barcode.jpg"
jpeg = File.binread(path)
z = ZBar::Image.from_jpeg(jpeg)
r = z.process
#barcode = r.first.data
end
end
I was having a really tough time getting not just Heroku to use the right Zbar, but Circle CI as well. I tried using Apt on the CI server to get the dev version, but could not get it working because of weird dependency issues. I ended up creating a heroku buildpack to take care of patching and building the right version, and I wrote a script to get the CI server to do the same.
Heroku:
https://github.com/sheck/heroku-buildpack-zbar
Circle CI:
https://gist.github.com/sheck/475e0c8f2d9f618f1eca
andy they have a success stories coming out of here check it out
https://github.com/willglynn/ruby-zbar/issues/8

Heroku deploy "Invalid RUBY_VERSION specified", worked yesterday

I was able to deploy to heroku yesterday just fine. We're on the cedar stack with a rails 3.2 application. When I deploy it gives me this:
$ git push -f heroku-ab-staging tmp-heroku-deploy-gochez_heroku_test-2012-05-08-10-43-39:master
Counting objects: 222, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (162/162), done.
Writing objects: 100% (191/191), 112.28 KiB, done.
Total 191 (delta 45), reused 13 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
!
! Invalid RUBY_VERSION specified: fatal:-Not-a-git-repository:-'.'-fatal:-Not-a-git-repository:-'.'-fatal:-Not-a-git-repository:-'.'-No-ruby-version-specified
! Valid versions: ruby-1.9.3-p0, ruby-1.9.3-p125, rbx-1.2.4, rbx-2.0.0dev-20120115-1.9, rbx-2.0.0dev-20120115-1.8, rbx-2.0.0dev-20120123-1.9, rbx-2.0.0dev-20120123-1.8, ruby-1.9.2-p290, jruby-1.6.5.1, jruby-1.6.7, ruby-1.9.3, ruby-1.9.2
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:myapp.git
! [remote rejected] tmp-heroku-deploy-gochez_heroku_test-2012-05-08-10-43-39 -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:myapp.git'
(Note that I changed my real app's name to myapp for privacy concerns)
Any idea what might be causing this? It was working just fine yesterday. What debugging can I perform to figure out what the issue is?
We changed the undocumented API you were using and released official version ruby support: http://blog.heroku.com/archives/2012/5/9/multiple_ruby_version_support_on_heroku/ You'll now need to use Bundler 1.2.0 +. Let me know if you have questions.

Resources