Chris Oliver

Joined

292,890 Experience
93 Lessons Completed
295 Questions Solved

Activity

Check out the gem documentation for some more info on I18n https://github.com/basecamp...

Posted in Button Loading Animations with jQuery UJS Discussion

Oh I bet that's the case. I would guess that the jquery-ujs script listens to the form's submit event and since you aren't firing it, it won't happen.

It seems you could probably call the jquery-ujs methods to disable the elements in your callback. https://github.com/rails/jq...

Posted in Button Loading Animations with jQuery UJS Discussion

It looks like when I change it to type="button" the form does not submit which means the JS won't fire either.

Posted in Button Loading Animations with jQuery UJS Discussion

Hmm. I've got this on the login page here on GoRails:

<button class="btn btn-success btn-lg btn-block" data-disable-with="&lt;i class='fa fa-spinner fa-spin'&gt;&lt;/i&gt; Signing in..." name="button" type="submit">Sign in</button>

Only other thing I can think of is maybe your jquery-ujs isn't being loaded successfully and so it never gets triggered on click.

Posted in Button Loading Animations with jQuery UJS Discussion

You won't use it with <input> at all because neither <input type="submit"> nor <input type="button"> allow for HTML inside of it. You'll have to use the <button></button> tag to use this.

Posted in Sending Data Between Controllers And Views | GoRails

I'm super happy to hear that! :) Let me know if you've got any other topics you'd like me to explain!

Posted in Errors Following the Deploy Rails Tutorial

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.

Posted in Errors Following the Deploy Rails Tutorial

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.

Posted in Errors Following the Deploy Rails Tutorial

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! :)

Posted in Errors Following the Deploy Rails Tutorial

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.

Posted in Errors Following the Deploy Rails Tutorial

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

Posted in Errors Following the Deploy Rails Tutorial

Is your database.yml created manually on the server or is it in your git repository?

Posted in Errors Following the Deploy Rails Tutorial

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...

Posted in Errors Following the Deploy Rails Tutorial

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.