I am configuring heroku_san for deploying Rails to Heroku. When I run any rake task it creates, I keep getting this error:
rake production deploy
No heroku apps are configured. Run:
rails generate heroku:config
I know that there are Heroku apps because I can see them when I run heroku list. What might be happening? Why can't this gem find the Heroku apps?
It looks like the gem was looking for a file called ~/.heroku/credentials. I did not have it. So I created that and added my user email and password separated by a linebreak:
myemail#gmail.com
herokupassword
Worked like a charm.
Related
I'm working through the odin project's web development course and I'm getting tripped up on the last part of the installations project where you are tasked with deploying a rails app to Heroku. I've been working on this for about a week but I refuse to give up but I realize that I need some help.
Here's the link to the tutorial I'm trying to work through (on a mac):
http://installfest.railsbridge.org/installfest/deploy_a_rails_app
I have a Heroku account set up, and am running Ruby 2.3.0 and rails 4.2.5.1. Rubygems are at 2.6.1 (but I tried them at 2.5.1 too).
Everything works fine but when I get to heroku run rake db:migrate I always get the time out error:
[~/railsbridge/test_app] ruby-2.3.0 $ git push heroku master
Everything up-to-date
[~/railsbridge/test_app] ruby-2.3.0 $ heroku run rake db:migrate
Running rake db:migrate on powerful-journey-35824... up, run.9421
▸ ETIMEDOUT: connect ETIMEDOUT 50.19.103.36:5000
I saw another post suggesting that the problem is a result of the connection I'm using blocking port 5000 (I'm at a library). I checked port 5000 on canyouseeme.org as well but it also timed out.
I then tried deploying the app detached using heroku run:detached rake db:migrate and it seems to work until I open heroku again and it shows that the page I'm looking for doesn't exist.
Basically what I'm asking is, does anyone have any idea why this test app isn't getting pushed from my terminal to the heroku deployment page?
I'm a python/django guy, but taking a guess the "everything up to date" message is likely because you have not commited your changes to git. Try:
git commit -a
git push heroku master
Now run your rake command.
I have a Rails 4.1.1 app which is hosted on heroku. Recently I changed my heroku login credentials.
In the terminal if I run for example the line:
heroku run rake db:migrate
It will successfully complete the task. "which heroku" gives: /usr/local/heroku/bin/heroku
In my Rails app I have a deploy rake task which calls the same command through system
task :staging do
...
system "heroku run rake db:migrate"
end
This however results in the error: Running 'rake db:migrate' attached to terminal... Authentication failure
In this case "which heroku" gives: /usr/local/rvm/gems/ruby-2.1.1#amn/bin/heroku
It's worth noting my app has the gem pgbackups-archive which requires the heroku gem.
How can I force the heroku gem version Rails is using to use my new login credentials or is there another way to fix this.
Thanks
The issue turned out to be with the Heroku gem.
The Heroku gem uses the user account API rather than login details. Updating the API key resolved the Authentication issue.
I have uploaded my app to heroku, its a simple app to test a login, it uses a gem named sorcery, but when I test it on heroku, I get Application Error
To upload to heroku I only have do this sequence:
git init
git add .
git commit -m "init"
heroku create
heroku push heroku master
heroku rake db:migrate
I get this error:
rake aborted!
undefined method `sorcery' for
#<Rails::Application::Configuration:0x0000000266e660>
)
Please help me, I think that the gem sorcery is causing this problem, but I dont know what to do.
You can see the website here
Does this work on you localhost?
I see form your list of commands that
bundle install
is not there.
Make sure you have
gem "sorcery"
in your gem file
Then do
heroku login
and
bundle install
You'll probably get other errors. Go to Getting Started with Rails 3.x on Heroku and follow the instructions.
I'm having a big problem right now. My site is written in Ruby on Rails, and I'm using the active merchant gem to interface with PayPal. The site is hosted on heroku.
I have an API key and API signature set as config variables in my heroku app. However, I still get the error:
Running: rake assets:precompile
(in /tmp/build_3pvaswdp7wvca1)
rake aborted!
An API Certificate or API Signature is required to make requests to PayPal
(See full trace by running task with --trace)
I can run heroku run rake assets:precompile separately and that works completely fine.
Furthermore, my staging site has the exact same config variables (RACK_ENV and RAILS_ENV are set to production on the staging site btw) set on my staging site and that seems to be working fine. However, my production site crashes.
Any ideas on what might be happening / how to fix this issue?
I just found out about this command:
heroku labs:enable user-env-compile -a myapp
BUT it is experimental.
I have now my rails 3.2.1 app running on Heroku.
I've tried to upload the database to mongohq via the heroku mongo:push command, after installing the heroku mongo plugin.
https://github.com/pedro/heroku-mongo-sync
I get the message asking me to confirm if I want to push, but once the push is done, there is nothing my db.
I'm not sure if it is a problem with heroku or if i'm missing a step.
Could it be that i need to put my app in production mode and migrate the database to production?
I'm not sure how to do that either.
Cheers
does your local heroku connection conform to the plugins assumptions [in the readme's config section]? if not you'll have to set it via:
export MONGO_URL = mongodb://user:pass#localhost:1234/db
i'll also note, that even after doing this i had to uninstall the heroku plugin and reinstall it from this fork: http://github.com/fjg/heroku-mongo-sync.git
heroku plugins:install http://github.com/fjg/heroku-mongo-sync.git
Check out the MongoSync Ruby Gem
It's a gem I wrote for that very purpose when I had to constantly copy my Local MongoDB database to and from my Production DB for a Project (I know it's stupid). It's extremely easy to use. Once you've entered your DB details in the mongo_sync.yml file, you can push and pull DBs using these rake tasks:
$ rake mongo_sync:push # Push DB to Remote
$ rake mongo_sync:pull # Pull DB to Local
Note: It's also available as shell script for non-ruby apps: mongo-sync