Chris Oliver

Joined

292,890 Experience
93 Lessons Completed
295 Questions Solved

Activity

Posted in Getting a 403 on Ubuntu + Nginx

So if it doesn't find the file, Nginx will hand it off to Passenger to try the Rails app. One thing that could be a problem is if your movieseat directory is owned by root or another user that doesn't have access to the directory. That would cause that error.

What's the output of:

ls -la /home/deploy/movieseat/current/

Posted in rbenv: bundle: command not found

I'd check your /var/log/nginx/error.log file for details.

Posted in rbenv: bundle: command not found

Those two lines were more notes of mine that you should set passenger_ruby differently if you built Ruby from source vs rv vs rbenv. You just choose which line is relevant to you. In this case since you are using rbenv, you can ignore the lines that don't have .rbenv in the folder name.

The instructions for installing Node seem to have gone missing. I ran into that yesterday too while building up a new Droplet myself. Also need some sprucing up of the database.yml + secrets.yml.

For both of those, start deploying, let it fail, and when it says it couldn't find database.yml, just ssh into the server, visit /home/deploy/myapp/shared/config and type vim database.yml and write your production database config in their. You want to keep these files only on production for security reasons. You'll do the same thing with secrets.yml and put it in your linked_files in config/deploy.rb inside your app if you're using Rails 4.

Posted in Using Vagrant for Rails Development Discussion

You might check this out http://spin.atomicobject.co...

Posted in rbenv: bundle: command not found

You should be able to find a file in the /var/log/nginx directory that will give you more details on what's going wrong. That looks right, but could be a handful of things that might cause the 403 Forbidden. There's usually an error.log file in there that will tell you if it can't find the directory or whatever else might be the case.

Posted in rbenv: bundle: command not found

Your ~/.bashrc file looks correct. It seems everything is loading rbenv as expected.

I believe you should just be able to say gem install bundler on the VPS now because the gem command will come from rbenv and install bundler inside of rbenv appropriately. After that, your Capistrano deploys should work using that version of bundler.

Posted in rbenv: bundle: command not found

That was an example from my local machine but you will want the same results on your server user.

One thing you might double check is that rbenv is being loaded in your ~/.bashrc file properly. I think it is, but that could be why it isn't using the right gem/bundler commands.

Posted in rbenv: bundle: command not found

It looks like your bundler on the machine is installed globally and not from rbenv. It might have been related to something you did previously. Basically you don't want to have to ever run sudo and if you do, you know something is configured wrong.

On my machine, I've got this (which is what you want, just with your user):

$ which ruby
/Users/chris/.rbenv/shims/ruby
$ which gem
/Users/chris/.rbenv/shims/gem
$ which bundle
/Users/chris/.rbenv/shims/bundle

It might be that you also don't have the gem command coming from rbenv. If you run gem install bundler and it doesn't use the rbenv gem command, it will use the system ruby and that's not going to be useful for you.

Posted in rbenv: 2.1.2 is not installed or not found

Haha, that would do it! I imagine that there are a few places where I could clean up the tutorial to show you on which machine to run which commands.

Posted in Using Vagrant for Rails Development Discussion

Yeah, /vagrant is inside the VM, not on your local machine.

Posted in File Uploading with Carrierwave Discussion

I would definitely still recommend Carrierwave for uploading songs too. It isn't just for images although that's often the most common example. You can have it work with any file type so this is what you'd want.

Posted in Setup Ubuntu 14.04 Trusty Tahr Discussion

Fixing. :)

Posted in Trouble With Form Objects

Does that mean you're able to remove the model_name method?

Posted in Trouble With Form Objects

Another code smell of the real problem is that you're doing

if @invitation.nil?

Which means that you're not creating an Invitation correctly. If you were, you'd be checking if it was valid or not. So you're not running validations and you're not creating the object in memory. There's something else going on here.

Posted in Trouble With Form Objects

Why does ActiveModel not automatically define this for you? The method is thrown on an instance of ActionController::Parameters which is what the params hash is, right? Are you sure you're instanciating the new model instance in the controller correctly?

Posted in Using Vagrant for Rails Development Discussion

You'll have to swap the MySQL instructions with Postgres ones. This tells Chef how to setup a MySQL server inside the Vagrant box, so you'll need to do the same for Postgres. I'm not sure of all the differences off the top of my head but a quick google search for postgres + chef should find you exactly whaty ou need.

Posted in Setup MacOS 10.10 Yosemite Discussion

Yeah, you may run into a few problems, but upgrading Homebrew and possibly a recompile or two and you won't have hardly any troubles. I updated my Macbook Air during the beta and didn't have hardly any trouble.

Posted in Setup Ubuntu 14.04 Trusty Tahr Discussion

If you set this up remotely, you need to manually run the rails server in an SSH connection and then visit the server IP with the port of 3000. So http://SERVER_IP:3000

A better thing to follow for AWS is the deploy tutorial where your Rails apps are hosted on something remote like AWS or Digital Ocean. It uses Nginx & Passenger so that your Rails apps are always running.

I just updated the notes to include the link to the Github project but it's here too! https://github.com/excid3/g...

Posted in Forum Series Part 2: Routes Discussion

I did actually. I ended up deciding to leave out a few pieces because they were ending up making the episodes really long without a lot of useful/interesting things.

Instead, I decided to put everything up on the Github repo so it you can still review those parts! https://github.com/excid3/g...