This is my first time trying to deploy a small application on heroku to apply for an summer internship.
I went through the getting started guide with rails.
Here is my log, its just too much code
http://pastebin.com/QqaKVdH3
Is there something wrong with my rails app and not part of heroku?
Did I run out of dynos? I head into my apps, click on my app, and put in 2 dynos and 1 worker for my app.
I have this in my procfile, hopefully this is correct !
bundle exec unicorn -p $PORT -E $RACK_ENV
bundle exec rake jobs:work
sorry to bother you guys, I know I need to familiarize myself with the heroku docs but if someone know the answer to this, I would love the help! I will just dig into the heroku docs when I got the time.
If you need more information please let me know.
Thanks!
The error you should start with is this:
2013-05-13T19:35:12.367382+00:00 app[web.1]: E, [2013-05-13T19:35:12.367055 #137] ERROR -- : uninitialized constant SimpleForm (NameError)
After you get past that hurdle and any others, be sure to checkout the Dev Center guide on Unicorn:
Deploying Rails Applications With Unicorn
Related
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.
Can somebody help me regarding on how can i solve my problem on Heroku. Im new to Heroku.
This warning always appear. WARNING:No Procfile detected, using the default web server (webrick). Im using Rails 4. Thank in advance
The error itself is pretty self-explanatory. No Procfile is detected, so in your root directory create a file called Procfile.
As you stated in your comment you are using the Unicorn server so inside the Procfile put this code.
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
I am assuming you created a unicorn.rb file
push to github, push to heroku and see if that works.
The Procfile holds the command for starting the server, and any options you need to pass to that. Your app was crashing because the command to start the server was not there at all.
https://devcenter.heroku.com/articles/getting-started-with-ruby#web-rb
I'm stuck at the "write your app" part. It gives a hello world example, so I tried doing that with vim:
The web.rb file reads as follows.
require 'sinatra'
get '/' do
"hello, world"
end
But, when I try and do: heroku addons:add newrelic:stark --app web.rb,
it says failed. app not found.
I'm probably missing something "obvious" because I've actually never worked with Heroku and hardly any Ruby before. Any help would be really appreciated.
If you're at "Write Your App", you haven't created a Heroku application yet, you've only just started writing the code for it.
Adding the newrelic add-on to a non-existent heroku app would likely give you that error.
Don't get ahead of yourself, finish the tutorial on creating the Heroku application before trying to add things to it.
I came across this behavior and was wondering if anyone else had seen it. I have a workaround so it's not a show-stopper.
I created a new app on Heroku with a Cedar stack. When demonstrating multiple environments I added the following config var:
heroku config:add RACK_ENV=staging --app appname
I visually verified that the environment var was set, then put the following route in my simple Sinatra example:
get '/?' do
ENV['RACK_ENV']
end
When I tested locally on my laptop, I received the expected development.
When I pushed to Heroku and hit the same route on herokuapp.com I got development instead of staging.
I switched the web server from Thin to Unicorn through the Procfile and pushed the changes back up to Heroku.
Now when I hit the route, I get the expected staging.
Has anyone else seen this? My workaround on another project where I was running Thin was to key the environment off of the New Relic app name. (I didn't switch to Unicorn because I need New Relic to work and currently Cedar and New Relic and Unicorn work together).
I had the same problem with sinatra and thin on the cedar stack using heroku's example sinatra app. The RACK_ENV refuses to be set to anything but development. (Heroku seems to think that it's RACK_ENV is set, since running 'heroku config' displays the environment you set, however in the app it's always development).
The same app on the bamboo stack had no problems.
EDIT: I submitted a ticket to heroku about this and got a really quick response which fixed the bug for me:
QUOTE:
It looks like there's a small bug in our default Procfile if you're using thin. Can you create a Procfile with the following in it?
web: bundle exec thin start -R config.ru -e $RACK_ENV -p $PORT
You can also set both your RACK_ENV and RAILS_ENV to staging using the Heroku gem ... then it works as expected. I think it may be a problem with Heroku.
Hi all: I'm on Heroku, installed delayed_job and am getting the above error when I attempt to run a background job. I've tried filing a ticket and scouring the net to no avail.
Thanks...Chris
You only use rake jobs:work to start a DJ worker locally. When on Heroku, you have to add workers: heroku workers +1 --app myapp. Those cost money though, so you might want to set workers back to 0 when you're done with it.
Edit:
Looks like this is clearly explained in the docs: http://docs.heroku.com/delayed-job#running-dj-workers-on-heroku.