sqlite3 blocking push to Heroku - ruby

I've followed all the questions on here already but am STILL getting an error pushing to Heroku.
Here's what I've done so far:
Remove sqlite3 completely from the gemfile, bundle, git commit and git push to Heroku.
Put sqlite3 into group :development, :test do, bundle, git commit and git push to Heroku.
Uninstall and reinstall sqlite3 gem, bundle, git commit and git push to Heroku.
Remove the Gemlock file, bundle, git commit and git push to Heroku.
Gem file:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'rails_12factor'
gem 'pg'
end
Git status is clean.
Git push heroku master failure log is here - http://pastebin.com/K2192h8A
Hopefully someone can let me know what I've done wrong. Thank you.

Ended up rebuilding the app and it is now deployed.

Always take care to look and make sure you are under the correct git branch!
if you are using
git push heroku master
then do the command
git branch
and make sure that you are under the master branch and not elsewhere. You are using git to push to heroku so it make not always be your rails app that is causing the problem. Be sure to
git add.
and
git commit -m "comment"
before looking at your rails app for mistakes.
this question solved this for me.
Heroku Push - Error with Git Push to Heroku

next time you buil a new app to get rid of all the fuss you must do the following: rails new -d postgresql ,if u don't have heroku addons installed do this heroku addons:add heroku_postgresql:hobby-dev
next heroku addons | grep POSTGRES and finally heroku run rake db:migrate
that should be it

Related

Is there a way to skip precompilation when I push on heroku?

When I push my code on heroku, with git, bundler and precompile run each time, even if I didn't change anything on my assets. Is there a way to avoid it?
Here's a good article about this problem : http://blog.alexmaccaw.com/faster-deploys
tl, dr :
In Gemfile:
gem 'dalli'
gem 'memcachier'
On the command line:
heroku addons:add memcachier:dev
heroku labs:enable user-env-compile
In config/environments/production.rb:
config.assets.cache_store = :dalli_store

Deploying to Heroku without a Gemfile

I'm working with an old Rails app that was initially built before Bundler and Gemfiles. Is it possible to push this app up to Heroku without a Gemfile? The app is in production on the Bamboo Stack and working without one. I'm trying to add a development environment on the Cedar Stack (Bamboo is now closed) and getting an error:
-----> Heroku receiving push
-----> Removing .DS_Store files
! Heroku push rejected, no Cedar-supported app detected
Is it no longer possible to push to Heroku without a Gemfile?
I'll add a Gemfile if that's what it takes.
The official word from Heroku Support:
Hi, yes you need a Gemfile for ruby apps; we don't have any gems
installed on the base system so that's how you specify them. That's
also how we detect it's a ruby app.
Also potentially useful: https://github.com/kch/gemfile-tool

Some heroku commands couldn't find my application

I can find my apps in heroku apps command, and also do some command to read information from app like heroku addons --app appname.
But I couldn't find my apps in some command like heroku addons:add addon_name, heroku pg:reset.
Work commands
heroku apps:
=== My Apps
my_app_1
my_app_2
(Also I can see my apps in heroku web dashboard.)
heroku addons --app my_app_1(not in my_app_1 folder):
=== my_app_1 Configured Add-ons
shared-database:5mb
heroku addons(in my_app_1 folder):
=== my_app_1 Configured Add-ons
shared-database:5mb
Doesn't work commands
heroku addons:add sendgrid(in my_app_1 folder):
! No app specified.
! Run this command from an app folder or specify which app to use with --app
heroku pg:reset DATABASE --confirm my_app_1(in my_app_1 folder):
Resetting SHARED_DATABASE (DATABASE_URL)... failed
! Resource not found
Here is my environment.
Max OS X Lion (10.7.4)
rvm 1.13.8 (stable)
ruby 1.9.3p194
heroku 2.26.5
Adding the heroku's remote configuration to git did the trick for me. Validate if you have it configured with git remote -v on the terminal and you should get something like:
heroku git#heroku.com:your-app.git (fetch)
heroku git#heroku.com:your-app.git (push)
if you don't, add it with
git remote add heroku git#heroku.com:your-app.git
It looks like the latest version fo the Heroku gem (2.26.5) is broken. A workaround is to downgrade to 2.26.3.
gem uninstall heroku -v 2.26.5
gem install heroku -v 2.26.3
It looks like you have a conflict between the Heroku gem, and the Heroku Toolbelt. I'm guessing you have installed the Heroku Toolbelt, but still have the Heroku gem in your gem file.
Remove the Heroku gem from your Gemfile and save.
Run the bundle command to update your Gemfile.lock
In Terminal, run gem uninstall heroku (NOTE: there may be multiple versions of the Heroku gem installed, and you'll need to uninstall all of them.)
In Terminal, run heroku addons
If you get heroku: command not found then you don't have the Heroku Toolbelt installed.
Install the Heroku Toolbelt and run the command again.
NOTE: If you're not in the app's directory, you'll need to add --app myapp1 to the Heroku commands.
Hope this helps.

Why my ruby application works locally and does not run on Heroku?

I have a Ruby 1.8.7 application that works correctly locally. To load it on Heroku, I changed the database from SQLite to PostgreSQL, install PostgreSQL 9.1.3, I changed the Gemfile replacing gem sqlite3 with:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
And changing the part production of config/database.yml with:
production:
adapter: postgresql
database: project_production
pool: 5
timeout: 5000
Then I run bundle install --without production successfully. Next I created a git repository with:
git init
git add *
git commit -m "text"
Later I create a heroku application with heroku create --stack bamboo-ree-1.8.7 , git push heroku master and heroku rake db:migrate successfully.
But it didn't work!
What's missing? I've done something wrong or I have not made ​​any statement?
Is "git add *" working ? I think you'd better use :
$ git add .
As Larsenal asked, could you post your logs ?
$ heroku logs
The basic information about heroku deployment is here.
You don't need the "production" block in database.yml, this is automatically generated by heroku when deploying.
Kind regards,
Max

Heroku wrongly detecting my Node app as a Ruby app

I have a Node project that is using Bundler and Guard to handle my pre-compilations steps.
This means that I have a Gemfile in the root of my project along with the package.json file.
My problem is that Heroku believes that my project is a Ruby app, just because the Gemfile exists. And complains that I have not committed the Gemfile.lock, which I don't want to commit.
-----> Heroku receiving push
-----> Ruby app detected
!
! Gemfile.lock is required. Please run "bundle install" locally
! and commit your Gemfile.lock.
!
! Heroku push rejected, failed to compile Ruby app
Is there a way to tell Heroku that the app is a Node app and not a Ruby app?
The solution to this, with a lot of help from Heroku Support is: use a build pack!
Override the Heroku default buildpacks by specifying a custom buildpack in the BUILDPACK_URL config var
$ heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs
You can also specify a buildpack during app creation
$ heroku create -s cedar --buildpack https://github.com/heroku/heroku-buildpack-nodejs
Simple when you know it. Some more documentation can be found at Heroku Dev Center
It seems there's a new way to do this as BUILDPACK_URL is now deprecated, explained here, but essentially the command is:
$ heroku buildpacks:set heroku/nodejs
You may also specify a buildpack during app creation:
$ heroku create myapp --buildpack heroku/nodejs

Resources