GithubHelp home page GithubHelp logo

rails-interview-likes's Introduction

Rails Interview <> Likes Exercise

1- Installing Ruby

  • Clone the repository by running git clone [email protected]:Wolox/rails-interview-likes.git
  • Go to the project root by running cd rails-interview-likes
  • Download and install Rbenv.
  • Download and install Ruby-Build.
  • Install the appropriate Ruby version by running rbenv install [version] where version is the one located in .ruby-version

2- Installing Yarn

  curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
  echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
  sudo apt remove cmdtest # Some Ubuntu systems comes with cmdtest installed by default.
  sudo apt-get update && sudo apt-get install yarn

3- Installing Rails gems

  gem install bundler --no-ri --no-rdoc
  rbenv rehash
  • Install basic dependencies if you are using Ubuntu:
  sudo apt-get install build-essential libpq-dev nodejs
  • Install all the gems included in the project.
  bundle install

Database Setup

Run in terminal:

  sudo -u postgres psql
  CREATE ROLE "rails-interview-likes" LOGIN CREATEDB PASSWORD 'rails-interview-likes';

Log out from postgres and run:

  bundle exec rake db:create db:migrate

Your server is ready to run. You can do this by executing rails server and going to http://localhost:3000. Happy coding!

Dotenv

We use dotenv to set up our environment variables in combination with secrets.yml.

For example, you could have the following secrets.yml:

production: &production
  foo: <%= ENV['FOO'] %>
  bar: <%= ENV['BAR'] %>

and a .env file in the project root that looks like this:

FOO=1
BAR=2

When you load up your application, Rails.application.secrets.foo will equal ENV['FOO'], making your environment variables reachable across your Rails app. The .env will be ignored by git so it won't be pushed into the repository, thus keeping your tokens and passwords safe.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Run rspec tests (bundle exec rspec spec -fd)
  5. Run scss lint (bundle exec scss-lint app/assets/stylesheets/)
  6. Run rubocop lint (bundle exec rubocop app spec -R)
  7. Push your branch (git push origin my-new-feature)
  8. Create a new Pull Request

About

This project is maintained by Nicolas Zarewsky and Federico Esteban and it is written by Wolox.

Wolox

rails-interview-likes's People

Contributors

nicozar95 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.