Skip to content

Codeology/codeology

Repository files navigation

README

(OUTDATED OLD WEBSITE) This is the website for the Codeology club at Berkeley

To make minor changes, please refer to materialize documentation to get familiarized with the CSS framework.

To update the website, please refer to our guide.

To make large changes skim getting started with rails to get familiarized with how ruby on rails works. Knowledge of MVC, how data is passed between them, and embedded ruby are of particular interest.

Design Documents

MacOS setup

Before getting started, make sure you're running the latest MacOS, installed all the security updates, and installed all XCode developer tools.

If you do not have Ruby on Rails on your system, please follow the instructions at installrails.com.

Check out this repository to your local workspace (GitHub for Mac is recommended, or simply use git clone).

Next, install rbenv and add ruby-build to manage your Ruby versions and gems (only install version 2.5.1 as other older/newer versions are not compatible with our website):

rvm install ruby-2.5.1
rbenv install 2.5.1
rbenv local 2.5.1
gem install bundler

You'll also need to have Homebrew and MySQL installed (This can be tricky on Mac OS X) because it's a dependency for the mysql2 gem:

brew install mysql

Finally, install the gems necessary for development, testing, and deployment. Make sure you are in the codeology folder directory in order to run this command:

bundle install

If you run into an error with incompatible Ruby Versions, check here and see if you need to update your ~/.bash_profile 's PATH accordingly).

If you have trouble installing 'pg' on Mojave, see here. You will have to install PostgreSQL (if you don't already have) to do this part:

brew install postgresql

If you have trouble installing 'libv8' on El Capitan, see here.

Make sure to run

rake db:setup

to initialize the website's internal database.

When developing on local, you need to instantiate a PG server instance in order to run Cucumber tests and start Rails on your local environment. The typical way to do this on Mac OS X is through

initdb /usr/local/var/postgres -E utf8

if you need to initialize a PG server instance, and

pg_ctl -D /usr/local/var/postgres -l logfile start

to start the server.

Windows Setup

You will need to install these:

  • A Ruby Installer You can find ruby-installer here. We are using Ruby 2.2.2. Make sure you select the appropriate version (32 vs. 64 bit).
  • A Ruby Manager You can find chruby here (the sibling to ruby-install). Chruby allows you to switch between multiple Rubies (Ruby Versions).
  • A Gem Manager You can find bundler here. Bundler makes managing gems (Ruby packages) easier for your projects. (gem install bundler)
  • Rails Run gem install rails
  • PostgreSQL which can be found here. Make sure you select the appropriate version to your OS (32 vs. 64 bit).
  • Ruby for VSCode (If you use VSC) Visual Studio Code has a package that has Ruby language and debugging support here.

Database:

  • These steps are necessary for you to run rails server to start up a local server for you to test/develop on.
  • After installing PostgreSQL, open pgAdmin (comes with installation) and create the databases listed in the database.yml file. Currently the dev database should be: "db/development" (the slash is part of the name)
  • You will also need to modify the database.yml file by adding: host: "" username: username password: password in the default block where username and passwords are what you set during installation of PostgreSQL. A detailed explanation of why we use host: "" can be found here.
  • If you plan on making changes to the database make sure you read up on migrations before doing so.

Issues

  • If you get an SSL Error you will need to update certificates: download and install most current gem
    • gem install rubygems-update-x.x.x.gem (make sure you cd into wherever you downloaded the gem for this command)
    • update_rubygems
    • gem update --system
  • You might need to download the devkit here and follow quick start instructions here

Additional Resources

  • Skimming getting started with rails can be helpful if you want a quick intro to the framework. Recommended if you have little/no experience with rails.