Skip to content
Nicolas Sebastian Vidal edited this page Jan 23, 2018 · 50 revisions

Notes on OSX installation

In order to work on LocalSupport on Mac, please fork and clone the project.

  1. Install RVM.

  2. Install Ruby 2.3.0.

  3. Fork the http://github.com/AgileVentures/LocalSupport repo (fork button at top right of github web interface).

  4. Clone the new forked repo onto your dev machine.

  5. cd LocalSupport.

  6. Install Qt webkit headers. Install Homebrew (if you don't have it already). If you do have Homebrew, run brew update after brew is installed or updated, type brew install qt. This will allow you to install capybara-webkit -v '1.0.0' successfully.

  7. Install postgreSQL. Type psql -U postgres into command line. Then you should see this:

     psql (9.6.1)
     Type "help" for help.
     postgres=#
    

At the psql prompt (postgres=#), type ALTER USER postgres CREATEDB; Then type \q to exit psql

  1. git checkout develop.

  2. Run bundle install to get the gems.

  3. Run npm install to get remaining dependencies.

  4. Run the following to get the database set up and import seed data (Note: db:setup is a custom task that invokes all required import and seeds. )

    bundle exec rake db:create
    bundle exec rake db:migrate
    bundle exec rake db:setup

If you hit problems, ask us on Slack chat.

[Note that rvm can be extremely helpful for managing ruby versions. Installing rvm on Ubuntu]

Debian 7 users can follow these instructions to launch Xvfb as daemon : Xvfb-on-Debian-7

Run locally

After that, in principle you can run rails server and see that app running locally.

The db/seeds.rb task that you ran added some organizations and a test user that you can experiment with. Read that file for more information.

Run tests

Also you should run the specs and cucumber features to make sure your installation is solid. For confidence, you shall prepare the test database first by running rake db:test:prepare(not needed in ruby starting from 2.0.0), then run tests using following commands:

bundle exec rake spec
bundle exec rake cucumber

and then when you start any BDD or TDD ensure autotest is running in the background:

bundle exec rake autotest

After that try running bundle install again.

Issues

  • If you are having issues with PostgresQL - see PostgreSQL install instructions

  • If you are having issues installing Qt webkit headers- see capybara-webkit gem

  • If you are experiencing this error /Users/yana/.rvm/gems/ruby-2.0.0-p643/gems/capybara-webkit-1.6.0/bin/webkit_server failed to start. (Capybara::Webkit::ConnectionError)

    Try the following steps:

    run brew doctor.

    If it happens that one issues is:

    Having additional scripts in your path can confuse software installed via Homebrew if the config script 
    overrides a system or Homebrew provided script of the same name.
    

    Check where your qmake is and if it is in the right place.

    Then remove the paths from your $PATH that are wrong and:

    gem uninstall capybara-webkit
    brew uninstall qt5
    brew install qt5
    brew linkapps qt5
    brew link --force qt5
    gem install capybara-webkit
    

    Now check that qmake is in the right place:

    which qmake
    
    /usr/local/bin/qmake
    
    

    And now your tests should pass. For more info please see this.