Why cant I run my rails app using heroku locally? - ruby

I am working on a new project that is using heroku, I get this error when I try to run the app locally:
Moped::Errors::ConnectionFailure at / Could not connect to any secondary or primary nodes for replica set <Moped::Cluster nodes=[<Moped::Node resolved_address="127.0.0.1:27017">]>
and I think it has something to do with Heroku because if I type
$ heroku info,
i get this error:
! You do not have access to the app disrupt.
I can't find this error anywhere on the internet, on any forums and there is nothing in the Heroku documentation.

The error normally just means that the MongoDB server is not running locally. Try starting it up by running mongod. Otherwise check you mongoid.yml to see how the development and test environments are set up to connect to MongoDB.
The other error that you get from heroku looks like a separate issue. As tolgap suggests you may just not be authenticated with heroku.

Related

How to view heroku logs when running an app locally?

I'm running my heroku app locally using heroku local web with this being the only line in my Procfile:
web:node index.js
How can I get it to print live logs while running locally?
I found this answer, but there are some things missing from that explanation, and I'm struggling with it, since I'm new to heroku. Any help is appreciated.

Inspect Heroku local logs

I have an app that's deployed to production, but I'm also testing it locally.
When I run heroku logs --tail, I get the production logs. I can see when I make a request to the webapp and it shows up instantly in the logs.
However, my app on heroku local returns me a "500 Server Error." I want to inspect these logs to understand why. However, I can't find these logs. Is there a command like heroku local logs --tail?
In order to see logs in IDE or Console use below command
Local:
I'm using Python script and the same deployed in heroku. I want to run locally by using heroku local command and would like to see logs in console but it is not showing logs in IDE Console. So for workaround i tried below command and it works well. Now I can see logs in the IDE itself.
E.g. for Python Script:
heroku local:run python test.py
E.g. for Rails:
heroku local:run rails console
Production:
heroku logs --tail --app <app-name>

Cannot get initialAdminPassword for jenkins on heroku

I am trying to get started with jenkins on heroku but I came across a problem is that now after deloying jenkins to heroku it wants to get the administrator password, and shows me this path /app/.jenkins/secrets/initialAdminPassword
I ssh'd into my heroku app and tried cat ( path ) but it shows there is no path like that on my heroku bash.
To set up my heroku server I followed this https://gist.github.com/jordansissel/2313443
I attached a picture of me trying in different ways
You can log out and then writeheroku logs --app yourappname
The password can be found there on the logs. If you cant see it, then restart the dynos.

How to debug an Heroku app, since logs don't help att all?

I'm trying to deploy a nodejs app on heroku for the first time, but I'm stuck at the command "heroku open" since it gives me an application error and no information as to where it crashed. The app runs locally without problem.
How would you proceed to debug this?
Thanks for your advice and time.
If running heroku local does not help, run a remote shell:
heroku run -a <your app name> /bin/bash, and there run npm start to see the logs and debug the issue on the Heroku server.
When running your app "locally", have you tried running heroku local? This runs the app through Heroku, but on local server.

heroku rails "load error expected app/app/model" instead just "app/model"

I have a Rails 2 application running well on my local machine at the moment. But fails on Heroku, here's the log: http://pastie.org/1957572
I can't figure out why the path is "app/app/model/.." instead of just "app/model...", is there anything I need to config my Rails app for Heroku?
Thanks!
You probably figured this out, but it's because /app is the root folder for apps on Heroku
It's like if you had it on your own VPS and it was in /var/www, then the error would read like "/var/www/app..."

Resources