Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I’ve set the environment variables following the steps above and when I try to connect to the production database I keep getting this error:
" Missing secret_token and secret_key_base for ‘production’ environment, set these values in config/secrets.yml "
I’ve tried to google an answer but am running around in circles! Here is what I have in my secrets.yml file:
development: secret_key_base: (mysecretkey)
test: secret_key_base: (mysecretkey)
production: secret_key_base: <%= ENV[“SECRET_KEY_BASE”] %>
And here is the .rbenv-vars file:
SECRET_KEY_BASE=‘mysecretkey’ export YAMAMA_DATABASE_PASSWORD=‘mydatabasepassword’
Any thoughts would be greatly appreciated!
Ok, I’ve made it to the end and want to see if I can get this working before I scrap it and start over - Unicorn and Nginx are both up and running. But when I connect to http://my_public_IP/tasks the browser displays that it can’t establish a connection to the server. I know there are a million things that could’ve gone wrong, but anything off the top of your head I should check to see why it’s not seeing my app?
Thanks for the great tutorial. Took me about a day and a half and rebuilding my server 4 times(plain ubuntu and unicorn+nginx). But finally got it to work. from plain ubuntu. I would suggest adding to your prerequisite postgreSQL tutorial the issues that might arise if locales aren’t set correctly before installing postgresql(fought with that for quite some time until I finally figured what the problem was),
But otherwise great tutorial.
When I get to the part where I install unicorn and try to start it, using:
sudo service unicorn_appname start
I get this error:
Starting appname
-su: bundle: command not found
(I literally named the app “appname”, just for testing purposes, fyi) I’m certain that all users can bundle. I’m lost and this error makes no sense to me. If anybody else has run into this error, I would appreciate your insight. Thanks.
Thanks Mitchell. This worked for me (although I did have to use source ~/.bash_profile instead of exec $SHELL)
One thing that’s not working as expected is re-deploying code. When I issue sudo service unicorn_appname restart, it doesn’t reload the new codebase (models, controllers, config, etc.). The Digital Ocean Nginx/Unicorn/Rails image refreshes the code upon a unicorn restart. Is there something I’m missing?
Also, maybe this is a similar problem, but when I issue sudo service unicorn_appname stop, and then sudo service unicorn_appname start the prompt says “Already running”
Thanks for the great tutorial.
When I try …sudo service unicorn_myapp start. I get this message
/etc/init.d/unicorn_myfriendlyroad: 13: /etc/init.d/unicorn_myfriendlyroad: Syntax error: “(” unexpected
I tried setting up a new droplet and starting over and still get the same message.
Help?!
I managed to fix the bash issue. However, I can’t get my site to run on port 80. I can see it on http:myapp.com:8080 but not on port 80. The connection is refused. I have a UFW and port 80 is added. I will post a question on the community board, seperately.
My nginx configuration followed the tutorial exactly, when I enter example.com in my browser, I get ERR_CONNECTION_REFUSED. If I add port 8080 example.com:8080, I can see my site. In dev, I was able to get it working on port 3000 using
My nginx configuration follows the configuration in the tutorial. I think it has something to do with the rbenv, or ? When I loaded my production database, I my database.yml would not read my password. By typing rbenv vars in the console, get the exports, but it would not take it when I tried to set up the production database. So, I copied and pasted them in place of the <%=ENV… > in mydatabase.ym. and secrets.yml (not ideal, but wanted to see if it worked). When I run RAILS_ENV=production rails server --binding=my-ip-address I see only HTML When I run sudo service unicorn_myapp start, I get … Starting my app and then bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell I logged a service ticket and they say “something isn’t working as expected in the init script unicorn_app”
I stuck with the config in the tutorial for Unicorn.rb and unicorn_myapp and followed the steps in the tutorial. I also made sure I have unicorn in my gems and did a gem install and bundle update to make sure.
I am able to use the command unicorn. (not unicorn_myapp) … and it gets this result I, [2015-06-01T21:22:52.143309 #22595] INFO – : listening on addr=0.0.0.0:8080 fd=9 I, [2015-06-01T21:22:52.144178 #22595] INFO – : worker=0 spawning… I, [2015-06-01T21:22:52.145277 #22595] INFO – : master process ready I, [2015-06-01T21:22:52.146540 #22639] INFO – : worker=0 spawned pid=22639 I, [2015-06-01T21:22:52.147100 #22639] INFO – : Refreshing Gem list I, [2015-06-01T21:22:54.089793 #22639] INFO – : worker=0 ready
Hi there, thanks for the tutorial, although, I can’t actually save my unicorn_appname file because it tells me “Unable to save /etc/init.d/unicorn_klein_and_sons - Error: No such file or directory”. I am using Sublime as an editor is that part of the problem?