view page source - page history - about editing

Revision History: Ruby on Rails

This is revision 623 of the page Ruby on Rails, as it appeared on Wed, 03 Sep 2014 16:26:09 -0700.
  1. Google OAuth2 with Ruby on Rails
  2. Loading seeds.rb data into test database through rake test
  3. Installing capybara-webkit on Ubuntu
  4. Enabling Jenkins support with Ruby on Rails tests

How I learnt Ruby on Rails

Following the Getting Started guide:
  1. Don't install the Cygwin version of Ruby or Ruby-rails. They will not work because I think cygwin paths get in the way of generating temporary files for Javascript compilation: Error: Cannot find module 'C:/cygdrive/c/DOCUME~1/Jevon/LOCALS~1/Temp/execjs20140124-6456-ws3la8.js' (in /usr/lib/ruby/gems/1.9.1/gems/turbolinks-2.2.0/lib/assets/javascripts/
  2. Install Ruby 1.9.3 from the Windows Installer package
  3. Install the Ruby 1.9.3 devkit: download the executable, extract it somewhere, follow the install instructions
  4. Install rails: gem install rails

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

On Windows, this error occurs because the Ruby on Rails install does not come with a server certificate package. As per this StackOverflow answer:
  1. Download into C:Railscacert.pem
  2. Go to your Computer -> Advanced Settings -> Environment Variables
  3. Create a new System Variable: SSL_CERT_FILE=C:Railscacert.pem
Close all your command prompts, including your rails server, and open up a new irb command prompt to test that it works:

$irb> require 'open-uri'
$irb> open('')

Partial not rendering

Make sure you use <%= render 'form' %>, not the non-printing form without equals <% render 'form' %>. I'm guessing this is a different render to render text: in a controller.

Adding a new database field after generation

Initial generation of a database table:

rails generate model User openid_identity:string created_at:date name:string
rake db:migrate

Adding a new field 'last_login':

rails generate migration add_last_login_to_users last_login:date
rake db:migrate

Could not find generator monban:scaffold

The generators were moved into a separate Gem, monban-generators - add this to your Gemfile.

view page source - what links to here? - page history - top
Last edited by jevon jevon 56 months ago