Cant seem to push to Heroku - ruby-on-rails

I am working with a rails app and I can't seem to be able to push my app to Heroku. I have set up everything and use git but everytime I push it to heroku I get this:
Unresolved dependencies detected; Installing...
Using --without development:test
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
You have added to the Gemfile:
* therubyracer (>= 0.8.2)
* libnotify
* rb-inotify
You have deleted from the Gemfile:
* growl
* rb-fsevent
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
I have noticed that my version of gem is 1.0.11 but the heroku push is using running Bundler version 1.0.7. I dont know if this makes a difference but I don't know how to go back to an older version.
Thanks for any help.

It looks like you failed to add your Gemfile.lock into the git repo for heroku.
Make sure it's not in your .gitignore, then:
git add Gemfile.lock
git commit -m "Adding Gemfile.lock"

If you have therubyracer in your Gemfile are you using Rails 3.1? You would be much better off running on the Cedar stack as opposed to the Bamboo stack. Cedar does not require the rubyracer gem to be in your gemfile. Bundler version doesn't matter in this case, 1.0.11 is used on Cedar whilst 1.0.7 is used on Bamboo but that's all managed by Heroku.

Related

Git Push Heroku Master error in rubyonrails

First off there is a lot of other errors I am getting, but I want to start with the lead error.. Ok so i want to push my project to my heroku server. I am in my apps directory and i run
"git push heroku master" and this is what i get
Identity added: /Users/some_ayodele/.ssh/id_rsa (/Users/some_ayodele/.ssh/id_rsa)
Initializing repository, done.
Counting objects: 145, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (124/124), done.
Writing objects: 100% (145/145), 31.06 KiB, done.
Total 145 (delta 27), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.5.2
New app detected loading default bundler cache
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Your Gemfile lists the gem pg (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem pg (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem jquery-rails (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
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:
* carrierwave
* rmagick
* heroku
* git-rails
* hoe (~> 1.5.1)
* RedCloth
* i18n
You have deleted from the Gemfile:
* thin
Bundler Output: Your Gemfile lists the gem pg (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem pg (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem jquery-rails (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
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:
* carrierwave
* rmagick
* heroku
* git-rails
* hoe (~> 1.5.1)
* RedCloth
* i18n
You have deleted from the Gemfile:
* thin
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:desolate-temple-6370.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:desolate-temple-6370.git'
First of all, I think Postgres is the issue here. I believe Heroku and Rails builtin PG causes some issue. Try editing your gem page like this:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
Then, do "bundle install".
If this doesn't work try doing "bundle install --without production"
Hope this helps.

BCrypt 3.1.2 update causing Heroku push to fail

Developing on x64 Windows 7 machine, Ruby 2.0, Rails 4.0.0.
To utilize has_password functionality, I needed to install BCrypt. Rails 4.0.0 supports BCrypt 3.0.0-3.0.9. However, those versions of BCrypt do not work on a x64 Windows machine and I had to update to BCrypt 3.1.2.
But, I also had to manually update the ..\activemodel-4.0.0\lib\active_model\secure_password.rb to reference bcrypt 3.1.2 (previously referenced ~>3.0.0)
begin
gem 'bcrypt-ruby', '~> 3.1.0'#changed from '~> 3.0.0'
require 'bcrypt'
rescue LoadError
$stderr.puts "You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install"
raise
end
Now my application and tests run locally. I made this change due to the answers on Issues using bcrypt 3.0.1 with ruby2.0 on Windows
However, now when I push to heroku, I get the following trace:
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install
rake aborted!
can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.
2. Make sure all dependencies are added to Gemfile.
.
.
.
!
! Push rejected, failed to compile Ruby/Rails app
I don't know how to get my app to run locally and on heroku with these changes. I'm not sure if I need to push to heroku a different way, or if I need to address the bcrypt issue a different way. Any help would be great.
Not that the last version of bcrypt supported my rails at this moment (4.0.0) is the version 3.0.1.
If you try a version higher that, you will get the error.
Regards
PS
I resolved this by updating from bcrypt-ruby 3.0.1 to 3.1.5.

Heroku Error when pushing to staging server

I have tried everything that I can find in StackOverflow as well as some other sites and my problem still exists.
Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
You have added to the Gemfile:
* libnotify
* rb-inotify
You have deleted from the Gemfile:
* growl
* rb-fsevent
Here is what I've tried and my Gemfile
https://gist.github.com/2244347
I thought that I head read in your Gist that you tried removing Gemfile.lock from your git and re-adding it. But since I don't see that I'm going to assume that you forgot to commit it:
git add Gemfile.lock
git commit -m "Adding Gemfile.lock"
bundle install
git add Gemfile.lock
git commit -am "Updated
Gemfile"
git push heroku master

Deploying rails app on heroku

I'm learning RoR and trying to deploy my test app to heroku receiving next error:
Unresolved dependencies detected; Installing...
Using --without developmen
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
You have added to the Gemfile:
* therubyracer (~> 0.9.3.beta1)
* pg
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
Please! Help!
Have you committed your Gemfile.lock?
bundle install
git add Gemfile.lock
git commit -am "Add lock file"
git push heroku master
This error might be because you did not completely do bundle install.
First do
bundle install
Add gem 'pg' to the gem file and install the postgres gems and postgres on your local machine. If you dont want to install postgres on your local machine then add gem 'pg to production environment and run bundle install without test environment. Though heroku discourages this way of running your application. It is always better to use same database for running locally and in production. Installing postgres is pain but it is worth it.
Your ruby should be 1.9.2.
After installing all the dependencies and post gres on your machine do bundle install and add your gem file to heroku.
git add Gemfile
git add Gemfile.lock
git commit
git push heroku master

Heroku Push Error: "sprockets-2.0.0.beta.2 in any of the sources"

I'm tryting to push my RoR 3.1.0.beta1 project up to Heroku from my Git repository using the following command as usual:
git push heroku master
But I am getting the following error:
-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
Installing rails_log_stdout... done
-----> 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 sprockets-2.0.0.beta.2 in any of the sources
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
My Gemfile has this line:
gem 'sprockets', '2.0.0.beta.2'
Sprockets version 2.0.0.beta.2 exists because I've been pulling different versions including this version. Is there something I'm missing here?
Thanks
Looks like this version has been pulled from Rubygems, only beta.12 and beta.13 are listed:
http://rubygems.org/gems/sprockets
So you'd need to get the specific beta.2 branch from the repo, as Thariq suggests.
BUT, I'd probably go for one of the versions listed on rubygems - there must be good a reason why they were pulled ;)
It's not on rubygems because:
You need to figure out what source you are getting the gem from and add that to the top of your gem file like so:
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'sqlite3'
gem 'sprockets', '2.0.0.beta.2'
gem "sprockets", "~> 1.0.2" is on ruby gems. But you will need to find where your versions is specifically hosted such as http://mysite.org add that to the top of your gemfile.
Presumably you've been pulling from the Sprockets Git Repo. You need to tell your Gemfile where you get a gem that's not in rubygems, so in this case you would use:
gem 'sprockets', '2.0.0.beta.2', :git => 'git://github.com/sstephenson/sprockets.git'

Resources