Installation/Script: Difference between revisions

From diaspora* project wiki
(Rewrite the page to be more specific)
Line 1: Line 1:
== Quick Start ==
== Foreword ==


Here's how to get a [http://guides.rubyonrails.org/getting_started.html development environment] up and running. This is where any new pod runner should start, as well as anyone looking to contribute to diaspora*.
This articles focuses on how to get a development environment setup on a linux distribution.
Besides installation means, the setting up should be pretty the same on Windows.
If you have any problem, don't hesitate to join us on [[IRC#IRC|IRC]]


This script assumes you have a [http://railsapps.github.io/installing-rails.html basic Rails setup installed].
The project uses the following tools with following versions. We will explain you how to get them :


==== Step 1: Run the script and follow the on screen instructions. ====
{|
! style="text-align:left;"| Tool
! Version
|-
| Ruby
| 2.0.0p481
|-
| Ruby Gem
| any
|-
| Rails
| 4.1.6
|-
| RVM
| any
|-
| Rspec
| 3.0
|-
| Bundler gem
| any
|}


  bash <(curl https://raw.githubusercontent.com/diaspora/diaspora/master/script/install.sh)
==== Step 1: Get the sources and install the tools ====


==== Step 2: Run the development server ====
The diaspora* project uses git and Github to manage sources. You can clone them with the following command :


  rails s
    git clone https://github.com/diaspora/diaspora.git


then visit 'http://localhost:3000' in your browser.
Then, to get the tools, you must use the packaging command-line tool of your distribution : <tt>apt-get</tt>, <tt>urpmi</tt>, <tt>yum</tt>, etc...
Ruby should be in every decent distribution repo :


==== Step 3 (for developers): Run tests ====
  # On Mageia/Mandriva :
  urpmi ruby
  # On Ubuntu/Debian :
  apt-get install ruby
  # On Fedora/CentOS :
  yum install ruby


  rake
The other tools might or might not be prepackaged by your distribution. On Mageia/Mandriva Linux, you should do the following :
 
  urpmi ruby-RubyGems
  urpmi ruby-rails
  urpmi ruby-rvm
  urpmi ruby-rspec
  urpmi ruby-bundler
 
Your distribution might have a different naming scheme for ruby packages. If they are not named the same way than on Mageia/Mandriva, you can search them with the following :
 
  # On Fedora/CentOS :
  yum search rvm
  # On Debian/Ubuntu :
  apt-cache search rvm
 
If you can't find any of these, you should be able to get all the required tools with RubyGems.
Please refer to the [https://rubygems.org/pages/download following page] to see how to install and use it.
 
It is better to use the tools packaged by your distribution than these installed by gem if they exists.
At least, you should have the <tt>rvm</tt> and <tt>bundler</tt> gems installed.
 
==== Step 2: Setting up the environment ====
 
Once you have <tt>rvm</tt> and <tt>bundler</tt> installed, place yourself in the diaspora source directory and type :
 
    # Will install the correct version of ruby
    rvm install 2.0.0-p481
    # Will use the correct version of ruby by default
    rvm use 2.0.0-p481 --default
 
the <tt>--default</tt> option will make ruby use the version by default in every shell. Without this option, you will have to type <tt>rvm use 2.0.0-p481</tt> each time you want to start the diaspora server.
 
Then, install all the required bundles :
 
    bundle update
 
One last step : configure all the config files ! Move to ''./config'' and copy all the ''.example'' files renaming them by removing the ''.example'' part.
You should have three : ''diaspora.yml.example'', ''database.yml.example'' and ''schedule.yml.example''. Or you can do it with one command-line... because it's cool !
 
    for file in `ls *.example`; do cp "$file" `echo "$file" | sed s/.example//`; done
 
Then, edit the file ''database.yml'' to set the credentials to your database. by default, it is using mysql, but you can set postgres.
You just have to comment the line <tt><<: *mysql</tt> and uncomment <tt>#<<: *postgres</tt>
 
If you want to work on the XMPP chat, please also follow the instructions [[Vines|there]].
 
==== Step 3 : start the server ! ====
 
    ./script/server
 
and go to the page [http://0.0.0.0:3000 http://0.0.0.0:3000]


==== Step 4 (for everyone): Party! ====
==== Step 4 : Run tests ====


  rake


== Main installation guides ==
==== Step 5 : Troubles ? ====
Want a production setup? Having trouble with the installation script? Want to install diaspora* the slow way?


Read the specific installation guides [http://wiki.diasporafoundation.org/Installation_guides here].
You have many ways to [[How_we_communicate|contact us]]

Revision as of 13:06, 24 September 2014

Foreword

This articles focuses on how to get a development environment setup on a linux distribution. Besides installation means, the setting up should be pretty the same on Windows. If you have any problem, don't hesitate to join us on IRC

The project uses the following tools with following versions. We will explain you how to get them :

Tool Version
Ruby 2.0.0p481
Ruby Gem any
Rails 4.1.6
RVM any
Rspec 3.0
Bundler gem any

Step 1: Get the sources and install the tools

The diaspora* project uses git and Github to manage sources. You can clone them with the following command :

   git clone https://github.com/diaspora/diaspora.git

Then, to get the tools, you must use the packaging command-line tool of your distribution : apt-get, urpmi, yum, etc... Ruby should be in every decent distribution repo :

  # On Mageia/Mandriva :
  urpmi ruby
  # On Ubuntu/Debian :
  apt-get install ruby
  # On Fedora/CentOS :
  yum install ruby

The other tools might or might not be prepackaged by your distribution. On Mageia/Mandriva Linux, you should do the following :

  urpmi ruby-RubyGems
  urpmi ruby-rails
  urpmi ruby-rvm
  urpmi ruby-rspec
  urpmi ruby-bundler

Your distribution might have a different naming scheme for ruby packages. If they are not named the same way than on Mageia/Mandriva, you can search them with the following :

  # On Fedora/CentOS :
  yum search rvm
  # On Debian/Ubuntu :
  apt-cache search rvm

If you can't find any of these, you should be able to get all the required tools with RubyGems. Please refer to the following page to see how to install and use it.

It is better to use the tools packaged by your distribution than these installed by gem if they exists. At least, you should have the rvm and bundler gems installed.

Step 2: Setting up the environment

Once you have rvm and bundler installed, place yourself in the diaspora source directory and type :

   # Will install the correct version of ruby
   rvm install 2.0.0-p481
   # Will use the correct version of ruby by default
   rvm use 2.0.0-p481 --default

the --default option will make ruby use the version by default in every shell. Without this option, you will have to type rvm use 2.0.0-p481 each time you want to start the diaspora server.

Then, install all the required bundles :

   bundle update

One last step : configure all the config files ! Move to ./config and copy all the .example files renaming them by removing the .example part. You should have three : diaspora.yml.example, database.yml.example and schedule.yml.example. Or you can do it with one command-line... because it's cool !

   for file in `ls *.example`; do cp "$file" `echo "$file" | sed s/.example//`; done

Then, edit the file database.yml to set the credentials to your database. by default, it is using mysql, but you can set postgres. You just have to comment the line <<: *mysql and uncomment #<<: *postgres

If you want to work on the XMPP chat, please also follow the instructions there.

Step 3 : start the server !

   ./script/server

and go to the page http://0.0.0.0:3000

Step 4 : Run tests

 rake

Step 5 : Troubles ?

You have many ways to contact us