Activity
Glad you got it working! The config/secrets.yml
works very similarly to your config/database.yml
and it's the file that you can store environment variables in with Rails 4.1+. You can create it on the server manually and have Capistrano symlink it just like database.yml or you can store a copy in your git repo which might be easier.
Awesome, making progress! :)
I think you might want to check your passenger_ruby
line in nginx.conf
to make sure it points to the right version.
You may actually need to do this from the postgres
user because it may be the only one that has admin permissions to do that. They set up their security permissions by default pretty well.
Check out this document https://help.ubuntu.com/community/PostgreSQL#Create_database
They mention:
sudo -u postgres createdb mydb
I can't remember what I used to create my pg database last time, but that looks about right.
Posted in Capistrano deployment errors
That would do it. Subtle but important! :)
Ah yeah, you need to run that in one of the releases directories (as long as your Rails code is in there). If there aren't any, you can create the database manually with the postgres command prompt.
That command they suggest there is incorrect if the database doesn't exist. You can ssh into your server and run the following command to create your db, then your deploy should be able to run the migrations.
RAILS_ENV=production bundle exec rake db:create
Is your database.yml
created manually on the server or is it in your git repository?
That's totally fine about environment variables. Been there too. ;)
I think you may want to try host
instead of url
. I've never used the url option before so that could be related. If the db is on the same server, you should use 127.0.0.1
instead of the public IP so that it doesn't have to connect to the outside world and it can run quickly internal to your server.
Posted in Capistrano deployment errors
I think (after looking at my server) that the ruby/1.9.1
folder is okay. I have a bunch of gems (420 apparently!) in that same ruby/1.9.1 folder and I've been using Ruby 2.1.5. It seems safe to ignore that bit.
The reason I think it is probably that is because the line #7 is this one and it is using the new version of the Ruby hash format
def add_days origin, days, config: nil
Which would give you that syntax error if you were running on an older version of Ruby.
Now one thing to note here is Capistrano doesn't load up bash which means it wouldn't initialize rbenv or rvm (whichever you are using). So it is possible that if you don't have rbenv/rvm configured right in Capistrano, it may be loading a different version of Ruby that came with your server. That might be the next piece to do some debugging on.
The capistrano-rvm
and/or capistrano-rbenv
gems are probably the ones to take a look at here and make sure it's executing the right version during the deploy.
Episode 33 covers the basics of OAuth using Omniauth and Twitter as an example that might be helpful for you. https://gorails.com/episode...
Yeah I was going to say, it seems like your Gemfile
is missing from the git repo.
Sounds like you're just about finished with it! That last error sounds like your database.yml file might be misconfigured. It looks like you've got the IP address on the line where the adapter should be. Can you paste your database.yml file so I can take a look?
Posted in Capistrano deployment errors
That's interesting. Is the version of Ruby running on your server the same version as the one you have locally by chance?
Posted in Setup MacOS 10.10 Yosemite Discussion
I think we have all been there more than a few times. ;)
Posted in Setup MacOS 10.10 Yosemite Discussion
Your SQL server may not be running either just because it wasn't started or because of an error. You'll want to run "brew info mysql" and read the notes for the command to start the server. You can run it manually to see if it starts, and then if that goes well, you can run the launchctl commands to have it start on boot.
Solid!
Oh of course. If you look at your routes, there is no POST
paths there. I think you can change the resources :like
to be singular instead like this: resource :like
and that will help.
In either case, your rake routes
should be creating a POST link to let you create a new like. It's odd that your current one doesn't have a POST route.
You could. I rarely have the need for going back to logs over 2 weeks old, so I don't keep them around. If you need to, you can always sync those somewhere.
Yup! The libraries have a couple different helper methods. I got confused using the wrong gem the other day. ;)
Hey Pablo,
Your link looks correct and so do your routes. Are you getting an error?
Posted in Token Auth API with Devise
That app is pretty good and I've used Devise token_authenticatable
in the past and it works pretty well. I'd recommend using as long as you don't need something complicated with your API tokens.
I think doing an episode on using token_authenticatable and one from scratch would be great. Are there any particular things you'd like to see covered in an episode?