Can Push to Heroku But Can't Run Migration - ruby-on-rails-3

I can push a Rails app to Heroku with ...
git push heroku
but when I try to migrate with ...
heroku run rake db:migrate
I get ...
Running rake db:migrate attached to terminal... failed
! You do not have access to the app my-app-name-1234.
Edit: my .git/config contains ...
[remote "heroku"]
url = git#heroku.com:young-mist-1198.git
fetch = +refs/heads/*:refs/remotes/heroku/*
Any ideas? Things look reasonable on the Heroku side and it seems like if my ssh key were bad, it wouldn't even let me push.

OK, I figured it out and in case it helps someone else ...
heroku auth:login
somehow I was not authorized and just needed to re-login.

try this
heroku run bash --app appname
heroku run rake db:migrate

Related

Heroku + Error occured while executing heroku run rake command

I am trying to deploy a sample app at Heroku. Whole code is pushed to heroku.
Now i am running a 'heroku run rake' command to create db and one table at heroku. But I am getting some error.
"A connection attempt failed because the connected party did not
properly"
I am not getting th way to resolve it.
Rails Console:
database.yml

Duplicate assets after deployment of app in Heroku

I'm very new with rails development and deployment using Heroku.
So recently I found that some JavaScript files that seems to be duplicated. For example I made a javascript function in one file (sample.js), then I erased this file, and I put the function inside of application.js.
Under my test development, it works perfect. But then when I commit the changes to heroku, I end up having the same function twice!
The javascript files are under the folder /app/assets/javascripts/
So how can I tell heroku to remove the duplicate files?
Am I missing some step before sending new version of my app to heroku?
Any help will be greatly appreciated
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
Rails 3.1.0
You're only deleting files from the repo when you use the git rm command. Even if you delete the actual file, it's still in the repo, and won't be changed by the git add -f * command (which only adds changed files).
You should be able to remove the file from heroku by running these commands:
$ git rm app/assets/javascripts/sample.js
$ git commit -m 'your commit message'
$ git push heroku master

QUEUE=* not found error on Foreman

I'm trying to use foreman to run my app locally, using the same Procfile I use when deploying my app on Heroku, where it works perfectly. However, when running foreman start on my terminal, foreman gives an error saying:
line 41: exec: QUEUE=*: not found
What I gather from this is that foreman doesn't recognize QUEUE=* as a command. So why does it work on Heroku? And what can I do to run the command exactly as it is run in production mode?
I ran into the same issue. You want to put the queue param at the end.
eg:
worker: bundle exec rake jobs:work QUEUE=hi

undefined method `args=' for [[]]:Sass::Tree::FunctionNode deploying to heroku with rails 3.1

I have an app that I am trying to deploy to Heroku Cedar stack with rails 3.1.0.rc5.
Some blogs that I followed implementing the migration to cedar and asset pipeline:
http://metaskills.net/2011/07/29/use-compass-sass-framework-files-with-the-rails-3.1.0.rc5-asset-pipeline/
http://devcenter.heroku.com/articles/rails31_heroku_cedar
http://railsapps.github.com/rails-heroku-tutorial.html
After a git push to heroku, I ran the assets:precompile task:
heroku run rake -t assets:precompile --app myapp
The js files are compiled fine, however Sass bombs compiling application.css.scss with error:
rake aborted!
undefined method `args=' for [[]]:Sass::Tree::FunctionNode
(in /app/app/assets/stylesheets/application.css.scss)
Full output and stacktrace here: https://gist.github.com/1122683
running bundle exec rake assets:precompile locally executes fine without errors.
It seems to be some kind of incompatibility between Sass 3.1.6 and blueprint; I added
gem 'sass', '3.1.5'
to my gemfile and that seems to have cleared it up

getting started (not) with Heroku: App not found

This should be simple, and I swear it was working an hour ago. I can log in to Heroku, but can't run any useful commands:
$ heroku login
Enter your Heroku credentials.
Email: xxx#whatever.com
Password:
$ heroku stack
App not found
$ heroku config
App not found
Perhaps this is the source of the problem?
$ git remote show heroku
! No such app as empty-samurai-345
fatal: The remote end hung up unexpectedly
empty-samuri-345 was an app I deleted earlier. All I really want to do is upload a new app using the bamboo-mri-1.9.2 stack.
Thanks in advance for suggestions...
You need to remove the heroku remote in git using this command:
git remote rm heroku
Then you can add a new remote using this one:
git remote add heroku git#heroku.com:your-app.git
Then try running your heroku commands.
Run the following
git config -l
The config key is easy to spot, remote.heroku.url.
Now if your comfortable editing the config directly, just:
git config -e
If not:
# Confirm you've got the right key
git config remote.heroku.url
# Substitute your_app_name appropriately
git config remote.heroku.url git#heroku.com:your_app_name.git
My answer is based off fearless_fool's comment, which lacks much detail.
FYI: The config file is located in /your_git_repo/.git/config
I just ran into this same problem by renaming my app from heroku online dashboard.
Then I tried running some command in cli from my local machine and it gave 'App not found'. I guess Cli doesn't know the change that I renamed my app.
So I again logged into heroku website and renamed the app with old name.
Then All commands worked from cli.
So Don't use online dashboard to rename your app, use CLI.
I hope it helps someone..!!