Changes to Installation
You are here: Home > Installation

Installation

(Raw wiki text)
O Motiro é desenvolvido e testado com maior freqüência em alguns sabores de Linux
-- especificamente Debian, Ubuntu, Fedora e Gentoo. Estes em geral devem ser melhores
sistemas para rodar o Motiro, mas ele também já foi testado e parece funcionar bem
com Microsoft Windows e Mac OS X.

Se você chegar a testar o Motiro em outra plataforma ou encontrar algum
problema com alguma das citadas acima, ficaremos felizes em receber seu relatório
de bug.

== Flocos ou chocolate? ==

O Motiro está disponível para download em dois formatos principais: como uma
Ruby Gem e como um tarball (tar.gz). Cada uma das duas soluções funciona tão
bem quanto a outra e ambos são bem fáceis de instalar, mas facilidade é uma
matéria bem subjetiva que depende do que você prefere ou sabe. Portanto é
melhor que você escolha por si mesmo.

A Gem deverá resolver a maioria das dependências automaticamente e deve dar
menos trabalho para instalar, mas irá instalar algumas bibliotecas no seu
sistema que talvez sejam um pouco mais difíceis de remover no futuro (nada de
impossível). Se você gosta de ter maior controle sobre o que está instalado em
seu sistema, talvez você prefira usar o tarball. Há poucas dependências e tudo
fica confinado em um diretório só ao invés de espalhado pelo sistema.

== Você vai precisar de... ==

O Motiro é escrito em [http://www.ruby-lang.org/ Ruby] e, para executá-lo, você
vai precisar do '''interpretador Ruby''' versão 1.8.5 ou superior. O
desenvolvimento do Motiro é baseado principalmente na versão 1.8.5,
portanto esta deve ser a mais estável, mas qualquer uma posterior a isto
deve funcionar.

Além do interpretador Ruby, para a instalação padrão, você vai precisar de
outros programas livremente disponíveis. Os programas marcados com
<code>(tar)</code> só precisarão ser instalados manualmente por quem optar pelo
tarball. Caso esteja fazendo a instalação via Gem, essas dependências serão
resolvidas automaticamente para você, mas as que estão desmarcadas precisam
ser instaladas manualmente por todos.

* [http://www.sqlite.org/ SQLite 3]
* Cliente de linha de comando [http://subversion.tigris.org/ Subversion] (svn) (somente se estiver utilizando repositório Subversion)
* Cliente de linha de comando [http://www.darcs.net/ Darcs] (darcs) (somente se estiver utilizando repositório Darcs)
* <code>(tar)</code> [http://popen4.rubyforge.org/ POpen4] 0.1.1
* <code>(tar)</code> [http://sqlite-ruby.rubyforge.org/sqlite3/ SQLite3-Ruby] 1.2.1

Você pode obter todos estes pré-requisitos a partir dos links fornecidos. Além
disso, muitas distribuições Linux disponibilizam todas estas ferramentas. Se
você tem um sistema Debian, instalar o cliente Subversion deve ser tão
fácil quanto:

<pre>$ aptitude install subversion</pre>

O comando exato pode ser diferente, mas deve ser possível achar um equivalente
para a grande maioria das distribuições Linux. Os dois últimos itens (que você
só vai precisar usar para instalação via tarball) podem ser obtidos em qualquer
sistema operacional via Ruby Gems:

<pre>$ gem install POpen4
$ gem install sqlite3-ruby</pre>

Depois de se certificar que seu sistema possui todos os pré-requisitos, você
pode continuar a instalação. Escolha seu método de instalação e prossiga para a
seção apropriada.

== Instalando a Gem ==

Para instalar a Gem e ver o seu Motiro local, bastam dois comandos:

<pre>$ gem install motiro --include-dependencies
$ motiro install &lt;algum local no seu sistema&gt;</pre>

Durante a execução do primeiro comando, será solicitado que você opte pela
versão de algumas Gems. Selecione uma versão compatível com sua plataforma.

Com isso o Motiro será instalado no local indicado e você pode fazer tantas
cópias quanto necessárias simplesmente repetindo o comando
<code>motiro install</code> para locais diferentes.

Ao final do segundo comando, vai ser informado o número da porta local que o
Motiro escolheu. Se abrir seu navegador em http://localhost:&lt;porta&gt;,
você já poderá apreciar seu Motiro e criar páginas nele. Para ativar o
repórter para coletar informação do seu repositório de código-fonte, continue
na seção ''Fazendo ele trabalhar para você''.

== Instalando o tarball ==

Depois de se certificar de ter todos os pré-requisitos, o próximo passo para
instalar a partir de um tarball é [[Download|baixar o arquivo]]. Depois que
estiver com seu pacote arquivado em mãos, escolha um local apropriado no seu
sistema de arquivos e desempacote o Motiro.

Para finalmente ver seu Motiro funcionando e conseguir editar algumas páginas,
basta executar uma linha de comando:

<pre>$ ruby script/server</pre>

Isto vai iniciar um servidor web na porta 3000. Daí para a frente só é preciso
apontar seu navegador preferido para http://localhost:3000 e apreciar sua
instalação. Depois de testar se tudo está funcionando, você muito provavelmente
vai querer que o Motiro comece a mostrar as notícias do repositório de código
do seu projeto.

== Fazendo ele trabalhar para você ==

O Motiro sai da caixa pré-configurado para seu próprio desenvolvimento porque
nós o usamos para acompanhar nosso próprio progresso. De verdade.

Isto pode ser satisfatório se você estiver interessado em nos ver trabalhar.
Porém a maioria das pessoas quer acompanhar seu próprio projeto, sua própria
equipe.

Para personalizar o Motiro para suas necessidades, é preciso editar o
arquivo de configuração <code>config/motiro.yml</code>. Por exemplo, suponha que
queiramos estar antenados no desenvolvimento do framework Ruby on Rails.
Podemos instruir o Motiro a olhar para o repositório Subversion
deles com a mudança da linha 'repo' para:

<pre>repo: http://dev.rubyonrails.org/svn/rails</pre>

Tudo que você precisa fazer é substituir o endereço do repositório do Motiro
pelo seu.

== Iniciando o agendador de tarefas ==

O Motiro usa um daemon independente que deve rodar em segundo plano para
atualizar as informações do repositório de controle de versão. Para iniciar e
interromper o daemon, pode ser usado o script <code>script/ticker</code>.

Para iniciar o agendador, tente ir para onde você instalou o Motiro e dizer:

<pre>$ ruby script/ticker start</pre>

De maneira análoga, para interrompê-lo, você faz:

<pre>$ ruby script/ticker stop</pre>

Em plataformas Windows, é melhor tentar iniciar o agendador com

<pre>$ ruby script/ticker run</pre>

e interrompe-lo apertando Ctrl-C.

Após alguns minutos o repórter terá acabado de executar seu trabalho e as
últimas revisões de código já estarão disponíveis no seu Motiro.

== Ambiente alternativo ==

Os processos de instalação descritos acima deverão usar um de dois servidores
web em Ruby (ou WebRick ou Mongrel, dependendo do seu sistema). Também é possível
rodar o Motiro com outros servidores web. Para usar o Apache, por exemplo,
consulte a página [[RunningUnderApache|rodando sob Apache]].

A instalação padrão usa o SQLite série 3.x, mas teoricamente é possível usar
qualquer 
[http://wiki.rubyonrails.com/rails/pages/DatabaseDrivers base de dados suportada por Rails].
Caso queira  usar MySQL, dê uma olhada na página
[[UsingMySQLAsDataBackend|Usando MySQL como base de dados]].

== Lidando com o inesperado ==

Estas instruções de instalação devem funcionar para boa parte dos casos. Se
você for agraciado com uma mensagem de erro em alguma destas etapas, não é
preciso se desesperar.
[[Gotchas|Nesta página]]
há soluções para algumas pegadinhas comuns que costumam nos enganar.

Se não conseguir achar uma solução para o seu problema aqui neste site, sempre
há a [http://groups.google.com/group/motiro lista de discussão].

--- en -------------------------------------------------------------------------

Motiro is developed and tested more often on some flavours of Linux -- specially
Debian, Ubuntu, Fedora and Gentoo. These probably should be the best available
systems to host Motiro, but it has been tested and seems to work pretty well on
top of Microsoft Windows or Mac OS X.

If you manage to test Motiro on another platform or happen to find any problem
with those listed above, we we'll be happy to receive your bug report.

== Strawberries or chocolate? ==

Motiro is available for download in two main flavours: Ruby Gem and good old
tarball (tar.gz). Each one of the solutions works as well as the other one and
both are very easy to install, but ease is a very subjective matter that depends
on what you prefer and know. So you are better of choosing for yourself.

The Gem will solve most dependencies automatically and will probably demand
less effort to set up, but will install some libraries into your system that
may be a little harder to remove in the future (nothing impossible, though).
If you like to have greater control over what is inside your system, maybe
you will want to use the tarball. It has few dependencies and everything is
placed inside a single directory instead of spread across your system.

== You will need... ==

Motiro is written in [http://www.ruby-lang.org/ Ruby] and, in order to run it,
you will need the '''Ruby interpreter''' 1.8.5 or later. Development is mainly
based on version 1.8.5, therefore that should be the most stable
one, but any later one should work.

For the default installation, in addition to the Ruby interpreter, you will
also need other freely available software.  The programs labelled
<code>(tar)</code> will only need to be installed manually if you choose to
install from the tarball. When using the Gem installation these dependencies
will be solved automatically for you, but those with no label need to be
installed by everyone.

* [http://www.sqlite.org/ SQLite 3]
* [http://subversion.tigris.org/ Subversion] command line client (svn) (only if you will be using a Subversion repository)
* [http://www.darcs.net/ Darcs] command line client (darcs) (only if you will be using a Darcs repository)
* <code>(tar)</code> [http://popen4.rubyforge.org/ POpen4] 0.1.1
* <code>(tar)</code> [http://sqlite-ruby.rubyforge.org/sqlite3/ SQLite3-Ruby] 1.2.1

You should be able to obtain all those requirements by following the links.
But if you are running a Linux distribution, you may want to check your distro's
repositories for the tools. For instance, in case you have a Debian system,
installing the Subversion client should be as easy as

<pre>$ aptitude install subversion</pre>

The exact command may be a little different, but it should be possible to find
a similar one for most Linux distros. The last two items (that will only be
needed when using the tarbal) can be installed on any operating system through
Ruby Gems:

<pre>$ gem install mediacloth
$ gem install daemons</pre>

After making sure your system has all those requirements, you may proceed with
the installation. Choose your installation method and proceed to the appropriate
section.

== Installing the Gem ==

In order to install the Gem and have your own local Motiro, you will only need
two commands:

<pre>$ gem install motiro --include-dependencies
$ motiro install &lt;somewhere in your system&gt;</pre>

This will automatically download Motiro together with any library dependencies
that may be needed and install it. While running the first command, you may be
asked to choose the version for some Gems. Just select one that happens to be
compatible with your platform.

After that, Motiro will be installed in your chosen place and you can make as
many copies as you want to. Just repeat the command <code>motiro install</code>
for different locations.

After the second command, you will be told the local port number that Motiro
chose to run on. If you don't mind pointing your favourite browser to
http://localhost:&lt;port&gt;, you will be able to enjoy your Motiro right
away. To activate the reporter that collects information from your source-code
repository, proceed to the section ''Making it work for you''.

== Installing the tarball ==

After double-checking if you have all the requirements, the next step needed
to install from a tarball is [[Download|downloading the file]]. As soon as you
get your hands on the archived package, choose an appropriate location in your
system and unpack Motiro.

That is all you need. You will only need to run one command to finally see
your Motiro running and try to edit some pages:

<pre>$ ruby script/server</pre>

This will start a web server on port 3000. From now on, you just need to point
your preferred browser to http://localhost:3000 and enjoy your installation.
After testing if everything is in place, you will most probably want to make
Motiro show news from your project's source code repository.

== Making it work for you ==

Motiro comes pre-configured to its own development needs because we actually
use it to keep track of our progress. Seriously.

This may be satisfactory if you are interested in watching us work.
But most people want to keep track of their own project, their own team.
   
To customize Motiro to your needs, you will need to edit the configuration
file <code>config/motiro.yml</code>. For example, suppose you are trying to
keep an eye on the development of the Ruby on Rails framework. You can make
Motiro look at their Subversion repository by changing the <code>repo</code>
line to

<pre>repo: http://dev.rubyonrails.org/svn/rails</pre>

All you need to do is change the Motiro repository address for yours.

== Starting the job scheduler ==

Motiro uses an independent daemon that runs on background to update the
information from the revision control repository. In order to start and stop
the daemon, you can use the script <code>script/ticker</code>.

To start the scheduler, try going where you installed Motiro and saying

<pre>% ruby script/ticker start</pre>

Analogously, to stop it, you do

<pre>% ruby script/ticker stop</pre>

On Windows platforms, you are better off starting the scheduler with

<pre>% ruby script/ticker run</pre>

and stopping it by hitting Ctrl-C.

After a few minutes the reporter will have finished his job and the latest code
revisions will be available on your Motiro.

== Alternative environment ==

The installation procedures outlined above will use one of two Ruby web servers
(either WeBrick or Mongrel, depending on your set up). It is also possible to run
Motiro with other web servers. In order to use Apache, for example, refer to the page
[[RunningUnderApache]].

The default installation uses SQLite series 3.x, but it is theoretically possible
to use any 
[http://wiki.rubyonrails.com/rails/pages/DatabaseDrivers database system supported by Rails].
In case you want to use MySQL, take a look at the page
[[UsingMySQLAsDataBackend]].

== Troubleshooting ==

These installation instructions should work for most cases. If you are
blessed with an error message during the process, there is no need to
pull your hair out (not yet). There are solutions for some common gotchas on
[[Gotchas|this page]].

If you can't manage to find a solution for your issue on this site, there
is always the [http://lists.sourceforge.net/lists/listinfo/motiro-devel-en mailing list].

Last update by FredMaranhao at Sat, 20 Oct 2007 12:59:34 -0500

Edit (requires authentication) | View wiki output | Page history (3 revisions)