I'm trying to deploy a Rack app to heroku and it's failing on the bundle step:
-----> Fetching custom git buildpack... done
-----> Ruby/Rack app detected
-----> Using RUBY_VERSION: ruby-1.9.3-p0
-----> Installing dependencies using Bundler version 1.1.rc.7
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
/tmp/build_158s9o0ec0gdk/Gemfile:2:in `evaluate': undefined method `ruby' for #<Bundler::Dsl:0x00000001c7c418> (NoMethodError)
(...)
/app/bin/bundle:23:in `load'
/app/bin/bundle:23:in `<main>'
There was an error in your Gemfile, and Bundler cannot continue.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rack app
The failure is undefined method 'ruby' for #<Bundler::Dsl:0x00000001c7c418> (NoMethodError)
This comes from my Gemfile
source 'https://rubygems.org'
ruby '2.0.0'
I assume it's being caused by the fact that that method wasn't added to Bundler until version 1.2 and heroku seems to be using version 1.1.rc.7.
I don't know how to upgrade the heroku version of bundler. I'm already on the Cedar stack.
The log says Fetching custom git buildpack – it looks like you’re using a custom buildpack, which might explain why the old version of Bundler is being used.
Does
heroku config:get BUILDPACK_URL
show anything? You might just need to stop using the custom buildpack, try
heroku config:unset BUILDPACK_URL
to clear the config var and revert to the normal buildpack.
Related
I'm currently working on a polyglot microservice that uses both nodejs and ruby (originally it was only nodejs). i need to install some gems for ruby.
TL;DR
gem install nokogiri => no directory permissions
sudo gem install nokogiri => sudo command not found
created Gemfile and bundle install => bundle command not found
gem install bundler => same as above
chown -R whoami /var/lib/gems/2.3.0 => Read-only file system
chmod -R 777 ../var/lib/gems/2.3.0/ => no errors but still read only directory
ruby -v
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
You can not manually maintain application dependencies via Heroku CLI.
When you deploy to Heroku, assuming you have picked 'Ruby' or 'Rails' as the Heroku application type, the buildpack it will bundle for you. https://devcenter.heroku.com/articles/getting-started-with-ruby#deploy-the-app
You can find your app type and build pack here:
https://dashboard.heroku.com/apps/HEROKU_APP_NAME/settings
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.4
remote: -----> Installing dependencies using 1.7.12
remote: Running: bundle install --without development:test --path
You should also know that Heroku Dynos are ephemeral. You do not have a dedicated server where you can SSH in and make file / permission changes that persist. Anytime your dyno resets or you push new code to production, your entire file system is 'regenerated' from git.
I'm trying to push my GitHub repo to Heroku.
Apparently my Gemfile is incorrect. I've checked it twice, and find no typos or anything, but it complains about rb-inotify being added and removed.
Here's the log:
Ruby app detected
Compiling Ruby
Using Ruby version: ruby-2.2.4
Installing dependencies using bundler 1.11.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have added to the Gemfile:
* rb-inotify
You have deleted from the Gemfile:
* rb-inotify
Bundler Output: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have added to the Gemfile:
* rb-inotify
You have deleted from the Gemfile:
* rb-inotify
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
I am having a problem with my application not being uploaded to heroku. When I typed in:
git push heroku master
I get an error at the end:
**Results logged to /tmp/build_2akv91a7tpdfl/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that gem install sqlite3 -v '1.3.7' succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby/Rails app**
When i tried installing the gems its asking for, and redid the process the same error message comes up even after i installed 'gem install sqlite3 -v '1.3.7.''
(For those who are following Michael Hartl rails tutorials i followed it by detail but I'm still getting an error message.)
Any help will be greatly appreciated. I am new to rails so if you have a solution, please do speak in layman's terms.
I don't think you can use sqlite3 on Heroku. You can use postgres instead.
Remove sqlite3 gem and add pg gem in your Gemfile.
gem 'pg'
Since Heroku provides you a PostgreSQL database for your app, edit your Gemfile and change this line:
gem 'sqlite3'
To this:
gem 'pg'
My goal is to deploy an app on Heroku for the environment 'heroku_production'.
My Gemfile looks like this:
source 'https://rubygems.org'
gem 'rails', '3.2.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test, :production do
gem 'sqlite3'
end
# This is needed in case this app is deployed in Heroku - in order to make the Heroku deployment independent from the production environment
group :heroku_production do
gem 'pg'
end
...
I set the BUNDLE_WITHOUT variable to "development:test:production". Here is the output when calling heroku config --app my_app:
=== my_app Config Vars
BUNDLE_WITHOUT: development:test:production
DATABASE_URL: postgres://XXXXXXX....
HEROKU_POSTGRESQL_CYAN_URL: postgres://XXXXXXX....
RACK_ENV: heroku_production
RAILS_ENV: heroku_production
But when I push my stuff to Heroku the BUNDLE_WITHOUT var is not applied as you can see in the following error message (line 3: --without development:test):
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.0.4)
...
Using pg (0.14.1)
Installing sqlite3 (1.3.7)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:my_app.git
! [remote rejected] 3dac67374c268d3bf9e051a6db39efc56ae81c76 -> master (pre-receive hook declined)
Why is Heroku doing that?
Googling didn't help as well.
Please note - for the time being, the Cedar stack does not support BUNDLE_WITHOUT.
From: https://devcenter.heroku.com/articles/bundler#specifying-gems-and-groups
I recently contacted Heroku about this issue, and they say that BUNDLE_WITHOUT now works!
Here's the response I got:
Hi,
user_env_compile is deprecated, but the functionality of this just became default for the Ruby buildpack - so you can use BUNDLE_WITHOUT config var.
I believe that you saw this article, but is that correct? https://devcenter.heroku.com/articles/bundler#specifying-gems-and-groups
Seems like we need to update that document!
Best,
[name redacted]
Haven't tried it yet but will soon.
Trying to deploy to Heroku but get the following error:
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test
Fetching source index for http://rubygems.org/
Could not find devise-1.4.6 in any of the sources
FAILED: http(preventing hyperlink)://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
I have "gem 'devise'" in my gem file, have "source 'http://rubygems.org'" at the top, and have run both bundle install and bundle update. Not sure why Heroku is looking for 1.4.6. Any ideas?
Thanks!
John
Here is the gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.9'
gem 'devise'
gem 'sqlite3', '1.3.3', :group => :development
Looks like devise 1.4.6 is no longer at Rubygems.com: http://rubygems.org/gems/devise/versions
I tried using devise 1.4.5, but it didn't work either.
You need to update the locked version of Devise in your Gemfile.lock.
$ bundle update devise
Then commit, push and deploy to Heroku.