Can't Push To Heroku (Can't find Rake 10.3.2) - ruby-on-rails

rails newbie here. I'm working through the tutorial on railstutorial.org on a Ubuntu 14.04 virtual machine. It's been pretty smooth sailing up until I got to heroku. When I want to push my app to heroku, it complains that it could not find rake-10.3.2. I checked heroku, and the application seems to be empty. However, I have rake-10.3.2 in my application, and if use "bundle show rake", it shows the correct version.
brandon#brandon-virtualbox:~/rails_projects/first_app$ bundle show rake
/home/brandon/.rvm/gems/ruby-2.0.0-p481#railstutorial_rails_4_0/gems/rake-10.3.2
That looks okay, but when I try to push it to heroku, I get:
brandon#brandon-virtualbox:~/rails_projects/first_app$ git push heroku master
Initializing repository, done.
Counting objects: 66, done.
Compressing objects: 100% (55/55), done.
Writing objects: 100% (66/66), 14.46 KiB | 0 bytes/s, done.
Total 66 (delta 6), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.6.3
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Could not find rake-10.3.2 in any of the sources
Bundler Output: Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Could not find rake-10.3.2 in any of the sources
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:dry-springs-4465.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:dry-springs-4465.git'
I noticed that it's using version 2.0.0 (which I have installed), but it's attempting to install the dependencies using 1.6.3. I'm not sure if that is related to the issue or not. My Gemfile is here:
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.8'
group :development do
gem 'sqlite3', '1.3.8'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
I've been messing with it for a while, and have had no luck. I'm using RVM as well, but I'm a total newbie so I'm not sure what kind of impact that would have. If anyone would know what's going on, I'd appreciate it!
Thanks!

In my case, this was caused because I had some gems, but not all of them, under version control in vendor/cache. It seems that when vendor/cache is present, Heroku will not go to any of the other sources.
I solved this problem by moving the gem that I needed cached to another location, and then removing the vendor/cache folder from version control.

Related

Heroku Ruby on Rails app push failed

Lately I upgraded my rails app from Rails 3 to Rails 5 and from Bootstrap 2 to Bootstrap 4 and after solving it all I am having some trouble uploading it to Heroku. I mean, in local it works perfectly with rails server. But when I have tried to upload it I get an error and I can't find any similar case on the Internet. This is what I get after git push heroku master:
Counting objects: 122, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (119/119), done.
Writing objects: 100% (122/122), 31.05 KiB | 1.48 MiB/s, done.
Total 122 (delta 77), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: Your app was upgraded to bundler 1.15.2.
remote: Previously you had a successful deploy with bundler 1.5.2.
remote:
remote: If you see problems related to the bundler version please refer to:
remote: https://devcenter.heroku.com/articles/bundler-version
remote: -----> Using Ruby version: ruby-1.9.2
remote: ###### WARNING:
remote: Removing `Gemfile.lock` because it was generated on Windows.
remote: Bundler will do a full resolve so native gems are handled properly.
remote: This may result in unexpected gem versions being used in your app.
remote: In rare occasions Bundler may not be able to resolve your dependencies at all.
remote: https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: -----> Installing dependencies using bundler 1.15.2
remote: Purging Cache. Changing stack from cedar to cedar-14
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
remote: Fetching gem metadata from https://rubygems.org/........
remote: Fetching version metadata from https://rubygems.org/..
remote: Fetching dependency metadata from https://rubygems.org/.
remote: Resolving dependencies...
remote: The latest bundler is 1.16.0, but you are currently running 1.15.2.
remote: To update, run `gem install bundler`
remote: Bundler could not find compatible versions for gem "rubygemsils (= 5.1.4) was resolved to 5.1.4, which depends on
remote: rubygems Bundler Output: Fetching gem metadata from https://rubygems.org/........
remote: Fetching version metadata from https://rubygems.org/..
remote: Fetching dependency metadata from https://rubygems.org/.
remote: Resolving dependencies...
remote: The latest bundler is 1.16.0, but you are currently running 1.15.2.
remote: To update, run `gem install bundler`
remote: Bundler could not find compatible versions for gem "rubygemsresolved to 5.1.4, which depends on
remote: rubygems ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to keepmefit.
remote:
I know it complains about my bundler version but it should be a warning and not a real error. I guess the problem must be in one of the gems that may not be compatible with Heroku or Rails 5 now but they give no problem on local server. Here's my Gemfile:
source 'https://rubygems.org'
gem 'rails', '5.1.4'
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
group :development, :test do
gem 'sqlite3'
gem 'activemodel'
gem 'json'
gem 'rspec-rails'
gem 'guard-rspec'
gem 'rb-notifu'
end
# Heroku uses PostreSQL
group :production do
gem 'pg'
end
group :test do
gem 'capybara'
gem 'factory_girl_rails', '4.1.0'
gem 'launchy'
end
group :development do
gem 'annotate'
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'coffee-script-source', '1.8.0'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
#gem 'bcrypt-ruby'
gem 'bcrypt', '~> 3.1.11', platforms: [:ruby, :x64_mingw, :mingw]
# HTML abstraction language (Haml)
gem 'haml'
gem 'haml-rails'
# Twitter Bootstrap
gem 'bootstrap-sass'
require 'rbconfig'
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
# HMTL 5 support
gem 'modernizr-rails'
# More icons!
#gem "font-awesome-rails"
# http://rubydoc.info/gems/bootstrap-datepicker-rails/1.0.0.7/frames
gem 'bootstrap-datepicker-rails'
gem 'tzinfo-data'
# Sample data
gem 'faker', '1.1.2'
# Pagination
gem 'will_paginate', '~> 3.1.0'
gem 'bootstrap-will_paginate'
# Turbolinks https://github.com/rails/turbolinks#turbolinks
# http://railscasts.com/episodes/390-turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks'
# https://github.com/rails/strong_parameters
# gem 'strong_parameters'
# http://railscasts.com/episodes/314-pretty-urls-with-friendlyid?view=asciicast
gem 'friendly_id'
# http://railscasts.com/episodes/324-passing-data-to-javascript?view=asciicast
gem 'gon'
gem 'cloudinary'
As one of the answers point, I have tried too with git pull heroku master and it returns:
From https://git.heroku.com/keepmefit
* branch master -> FETCH_HEAD
* [new branch] master -> heroku/master
Already up-to-date.
Also git push -f heroku master and the output is the same as using git push heroku master so the error is still there and the push is rejected.
Any help is appreciated.
It seems that the stack (cedar-14 or cedar) is a really old one. Upgrading the stack to Heroku-16 will solve the issue.
It looks like you heroku remote is conflicting with the files you are trying to push (after your upgrade). You have two options
1 - Clean / merge up with your new changes the heroku remote and push again
git pull heroku master
Fix any conflicts / clean up etc..
git push heroku master
2 - Force push your new changes
NOTE: THIS ACTION WILL OVERRIDE WHAT YOU CURRENTLY HAVE IN HEROKU. So make sure that you dont need any changes that are already on heroku.
git push -f heroku master

heroku push factory_girl_rails bundle install error

I am trying to push my app to heroku. I type git push heroku and it returns with this:
git push heroku
Counting objects: 55, done.
Compressing objects: 100% (35/35), done.
Writing objects: 100% (36/36), 10.30 KiB, done.
Total 36 (delta 16), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --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 deleted from the Gemfile:
* factory_girl_rails (= 4.2.1)
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 deleted from the Gemfile:
* factory_girl_rails (= 4.2.1)
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:appname.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:appname.git'
I have added and removed factory_girl_rails to the gemfile multiple times and ran bundle install along with it.
I have tried doing the directions it gives, but I am unable to get it to work.
I am not sure what the problem is but it won't push to heroku.
Can anyone help?
Here is my gemfile:
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.1'
gem 'bootstrap-sass', '2.3.2.0'
gem 'devise'
group :development, :test do
gem 'sqlite3', '1.3.8'
gem 'rspec-rails', '2.13.1'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.1'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
This is what it looks like with factory_girl_rails in my Gemfile.
I solved this by commenting out
config.force_ssl = true
This was in the config/environments/production.rb file.
Any idea why this caused an error?

Bundler Rails 4.0 App Error When Pushing to Heroku

Before this question gets closed as duplicate let me first say that I have tried multiple solutions presented in questions of similar nature. I am working through the Ruby on Rails 4.0 Tutorial and I have gotten as far as pushing my code to Heroku. However, whenever I run the following:
$ git push heroku master
I get the following:
Counting objects: 74, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (63/63), done.
Writing objects: 100% (74/74), 15.59 KiB, done.
Total 74 (delta 11), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
/usr/bin/env: ruby1.9.1: No such file or directory
Bundler Output: /usr/bin/env: ruby1.9.1: No such file or directory
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby/Rails app
To git#heroku.com:example.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:example.git'
I have tried several things including changing my Gemfile (see below)
Gemfile :
source 'https://rubygems.org'
ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
group :development do
gem 'sqlite3'
end
# Use SCSS for stylesheets
gem 'sass-rails', '4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.1.1'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '2.2.1'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '1.1.1'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '1.0.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
end
gem 'rails_12factor', group: :production
and editing the configuration variables
$ heroku config:set GEM_PATH = vendor/bundle/ruby/1.9.1
$ heroku config:set PATH = bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
I have also tried running bundle from Heroku using
$ heroku run "bundle update"
However I get this error
bash: bundle: command not found
I have also checked my logs but those are only good for post deployment problems.
Does anyone know how to fix this problem?
Perhaps there is a missing file or directory on the Heroku side of things.
It appears that in order to solve this problem you need to turn off Bundler's stub generator, because Rails 4 apps do not store stubs in the app's bin/ directory. In order to do this use the following commands:
$ bundle config --delete bin
Then you need to update the bin directory to use the new Rails 4 executables
$ rake rails:update:bin
Then add the new bin/ directory to your version control using:
$ git add bin
Commit the changes and push your code to Heroku

Rails bundler: "Could not find tilt-1.3.5 in any of the sources"

I have never encountered this problem before so I really don't know where to start looking for answers... despite Google ofcourse which seems to be an empty road concerning this topic.
When I try to push my application to heroku I get this message:
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.5
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/..
Could not find tilt-1.3.5 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
I have destroyed my gemset and started over numerous amounts of times, as well as flat-out required tilt in my Gemfile, but no luck, I still get this message.
Like I said, I have never got this error until yesterday and assumed it was a minor bug that would be fixed. Seems as if that isn't the case, and I am scratching my head trying to figure out what needs to be done to fix this issue.
Any suggestions?
EDIT GEMFILE
source 'https://rubygems.org/'
gem 'rails', '3.2.12'
gem 'thin'
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'bootstrap-sass'
gem 'will_paginate'
gem 'bootstrap-will_paginate'
gem 'jquery-rails'
gem 'rails_autolink'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg', '0.14.1'
end
I am getting the same error. As iRichLau noted in this comment, locking to 1.3.4 or 1.3.6 works.
In Gemfile:
gem 'tilt', '1.3.4' # or '1.3.6' is now out and also works.
Then bundle:
bundle update tilt
Make sure the commit message is commensurate with the ridiculousness of this phantasmal error. ;)
running bundle update and then git add before pushing should fix it
This happened to me when I had 2 different version of the brightbox gem.
The newer brightbox gem requires a newer version of bundle.
So in the top of my deploy.rb I forced the brightbox gem version to be:
gem 'brightbox', '2.3.8'

Heroku push rejected, Ruby Version Changed Detected, Could not find net-scp-1.0.6

I can't figure out what is going on here. I deployed to Heroku on Tuesday with no problem. I have not changed my Ruby version locally or on the Gemfile but heroku is telling me that I have changed Ruby Versions & it's unable to find net-scp-1.0.6. Everything works perfectly locally, I have search around and can't find anything addressing a similar problem.
Counting objects: 81, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (62/62), done.
Writing objects: 100% (62/62), 10.77 KiB, done.
Total 62 (delta 49), reused 0 (delta 0)
-----> Deleting 8 files matching .slugignore patterns.
-----> Removing .DS_Store files
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.0.pre.5
Ruby version change detected. Clearing bundler cache.
Old: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
New: ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
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/..
Could not find net-scp-1.0.6 in any of the sources
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
This is what my Gemfile looks like.
source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '~> 3.2.11'
gem 'aws-sdk'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'pg'
gem 'thin'
gem 'best_in_place'
gem 'stripe'
gem 'paperclip'
gem 'coffeebeans'
gem 'mail'
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'carmen'
gem 'haml'
gem 'devise'
gem 'sinatra', '~> 1.3.2'
gem 'dynamic_form'
gem 'fog', '~> 1.3.1'
gem 'wicked'
gem 'lazy_high_charts', '~> 1.1.5'
gem 'jquery-datatables-rails'
gem 'sass-rails'
group :assets do
gem 'uglifier', '>= 1.0.3'
gem 'coffee-rails', '~> 3.2.1'
end
group :test, :development do
gem 'hirb'
end
Any ideas would be appreciated. Thanks.
The net-scp-1.0.6 gem was yanked recently.
Locally, run:
gem cleanup
bundle update
Then commit and push, it will update net-scp to the latest version and you'll be fine.
Looks like I figured this out. This issue was caused by net-scp being yanked from Ruby Gems due to security concerns. I followed the instructions on this Fog issue (https://github.com/fog/fog/issues/1561) and locked net-scp down to 1.0.4 and life is back in order.

Resources