| 1 | [[PageOutline]] |
| 2 | |
| 3 | [wiki:howto <- Back to the HOWTO section] |
| 4 | |
| 5 | = About RubyOnRails = #about |
| 6 | |
| 7 | TODO |
| 8 | |
| 9 | Please note: |
| 10 | |
| 11 | MacPorts packages some outdated versions of Rails like |
| 12 | * `rb-rails @2.3.5` |
| 13 | * `rb19-rails @3.0.5` |
| 14 | In ideal world the packaging of these modules would be better and more up-to-date, so that installing Ruby on Rails would be as straightforward as |
| 15 | {{{ |
| 16 | port install rb22-rails4.2 |
| 17 | }}} |
| 18 | but until then you need to use other tools with a wider base of maintainers. |
| 19 | |
| 20 | = Installation = #install |
| 21 | |
| 22 | These instructions are based on https://gorails.com/setup/osx/10.10-yosemite, but skipping the part that explains how to install another package manager. |
| 23 | |
| 24 | == Installing rbenv and ruby-build == |
| 25 | |
| 26 | You first need to install the necessary tools: |
| 27 | {{{ |
| 28 | port install rbenv ruby-build |
| 29 | }}} |
| 30 | |
| 31 | == Adding rbenv to ~/.bash_profile (optional) == |
| 32 | |
| 33 | If you want to enable `rbenv` by default, you can add `eval "$(rbenv init -)"` to `~/.bash_profile`: |
| 34 | {{{ |
| 35 | # Add rbenv to bash so that it loads every time you open a terminal |
| 36 | echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile |
| 37 | source ~/.bash_profile |
| 38 | }}} |
| 39 | |
| 40 | Please note that this will hide the ruby as installed by MacPorts using `port select ruby ...`. If you want to switch back to that version of ruby, you should comment out that line in `~/.bash_profile` again. |
| 41 | |
| 42 | == Installing Ruby == |
| 43 | |
| 44 | {{{ |
| 45 | rbenv install 2.2.3 |
| 46 | rbenv global 2.2.3 |
| 47 | ruby -v |
| 48 | }}} |
| 49 | |
| 50 | == Installing Rails == |
| 51 | |
| 52 | {{{ |
| 53 | gem install rails -v 4.2.4 |
| 54 | }}} |
| 55 | |
| 56 | To make sure that `rbenv` knows about the new version of rails you additionally need: |
| 57 | |
| 58 | {{{ |
| 59 | rbenv rehash |
| 60 | }}} |
| 61 | |
| 62 | === Problems === |
| 63 | |
| 64 | (TODO) |
| 65 | |
| 66 | There might be some problems related to installation of nokogiri. |
| 67 | |
| 68 | = Setting up the Database = #database |
| 69 | |
| 70 | TODO |
| 71 | |
| 72 | (see also [wiki:howto/MySQL MySQL HOWTO]) |
| 73 | |
| 74 | [wiki:howto <- Back to the HOWTO section] |