heroku push factory_girl_rails bundle install error - ruby-on-rails

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?

Related

Heroku push rejected, failed to install gems via Bundler #2

I'm new to ruby on rails and working on a project on AWS cloud9. I went through other posts on stackoverflow but still couldn't find the solution to solve the error below. I have tried bundle install, bundle update, git add Gemfile.lock, none of them worked for me.
ec2-user:~/environment/saasapp (master) $ git push heroku master
Counting objects: 7991, done.
Compressing objects: 100% (6447/6447), done.
Writing objects: 100% (7991/7991), 48.09 MiB | 47.95 MiB/s, done.
Total 7991 (delta 1044), reused 7778 (delta 967)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.4.1
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find pg-0.18.4 in any of the sources
remote: Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find pg-0.18.4 in any of the sources
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to radiant-tor-65852.
remote:
To https://git.heroku.com/radiant-tor-65852.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/radiant-tor-65852.git'
Here is the gem file:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.4.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 4.3'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
# Use Twitter Bootstrap library for front-end UI and layout
gem 'bootstrap-sass', '3.3.7'
# Use Font Awesome sass gem for adding icons
gem 'font-awesome-sass', '~> 5.0.13'
# Use Hirb for better db display in console
gem 'hirb', '0.7.3'
group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :production do
# Use the PostgreSQL gem for heroku production servers
gem 'pg', '~> 0.20.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
OK, I got the solution.
First, type this command line:
sudo yum install /usr/include/libpq-fe.h
Then:
bundle install --with production
Worked for me!

failed push to heroku using rails 4

i try to deploy my rails app to heroku, but when git push heroku master i get error like this :
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
New app detected loading default bundler cache
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 added to the Gemfile:
* pg
* carrierwave
* debugger
* rails_12factor
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:
* pg
* carrierwave
* debugger
* rails_12factor
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
why i get error like this? i already to try bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment and run git push heroku master again but i still get same error like before???
i'm using ruby 2.0 and rails 4, please tell me if i'm wrong? thanks before
Edit:
my gemfile:
source 'rubygems.org';
gem 'rails', '4.0.1'
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 1.2'
group :doc do
gem 'sdoc', require: false
end
gem 'devise'
gem "twitter-bootstrap-rails"
gem 'carrierwave'
gem 'debugger',
group: [:development, :test] gem 'rails_12factor'
You can simply delete Gemfile.lock file then commit and push to heroku again.

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.

Heroku push rejected - Hartl's Rails 3.2 tutorial

I am a ruby, ruby on rails and heroku greenhorn, which is trying to learn to code from Michael Hartl's Ruby on Rails 3.2 tutorial.
Now at the very beginning of this chapter I failed to deployed all to Heroku. This error message I got (but I have no plan what to do to solve this problem):
$ git push heroku master
Counting objects: 69, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (54/54), done.
Writing objects: 100% (69/69), 27.34 KiB, done.
Total 69 (delta 5), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.2.0.rc
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/
Fetching gem metadata from https://rubygems.org/........
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 3.2.6) ruby depends on
railties (= 3.2.6) ruby
jquery-rails (= 2.0.0) ruby depends on
railties (3.2.7.rc1)
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:pacific-anchorage-8098.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:pacific-anchorage-8098.git'
My Gemfile looks like this:
source 'https://rubygems.org'
gem 'rails', '3.2.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.10.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.0'
group :test do
gem 'capybara', '1.1.2'
end
group :production do
gem 'pg', '0.12.2'
end
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
I hope someone could help me out (sorry, I am a beginner --> also at Stackoverflow, lol).
KR, Fabian
The default generated Gemfile (with rails 3.2.6) does not specify a jquery-rails version to use. I would recommend doing the same, like so:
# remove version number, just like you would see in a fresh rails app
gem 'jquery-rails'
The version you have required, 2.0.0, relies on railties 3.2.7.rc1 gem, which you can't use with rails 3.2.6.
I used your code in my app, and couldn't get it to bundle on my local host. This makes me wonder if you tried that too yourself before pushing to heroku. You should always bundle install on your local machine first.
Also, you appear to have bumped the required version numbers of sass-rails and coffee-rails. Here's what you'd expect in a clean rails app's Gemfile:
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
I could now solve the problem by myself. This was the way:
Go to Gemfile and change the section with gem 'rails', '3.2.6' to gem 'rails', '3.2.7rc1'.
save
run bundle install --without production
run git add .
commit to git like git commit -a -m "Heroku recommit
push to github like git push and follow the instruction for username and password
and last git push heroku master
Wow, this was hard, but very educational :-)
The problem is the jquery-rails gem needs a different version of railties than the rails gem in your bundle file. You can try to remove the "2.0.0" from jquery-rails and try again. Bundle will install a version of the gem which works wit version 3.2.6 of railties.

Resources