-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Sharetribe wiki!
This is currently the central place for documentation related to running Sharetribe software on your server or participating in the development.
The wiki is a community effort, so feel free to edit any page to improve the documentation. And if you feel that something is missing or wrong, please report in the Issues.
NOTE: If you try installing and encounter problems, please report them for example in Issues. We try to help you and enhance the documentation.
You can also ask for help in Sharetribe Help & Support Flowdock
Below the installation instructions there is space for Operating system-specific tips, so if you have problems, check there, and if you get your problem solved, add instructions to the tips section.
- Install
- Get the code (git clone is probably easiest way:
git clone git://github.com/sharetribe/sharetribe.git
) - Go to the root folder of Sharetribe
cp config/database.example.yml config/database.yml
- You need to have a database available for Sharetribe. And a DB user account that has access to it. (If you are going to do development you should have separate databases for development and testing also).
- You can download MySQL from here.
- These commands can help you in the making of the needed user and databases.
- Edit details according to your database to config/database.yml (if you are not going to develop Sharetribe, it’s enough to fill in the production database)
- Probably you only need to change the passwords to the same that you used when creating the databases.
cp config/config.example.yml config/config.yml
- Edit details according to your system configuration to config/config.yml. If there is something unclear, post a question for example to Issues.
- If you are planning to run Sharetribe in production mode on your local machine (without Apache or similar server in front) you’ll need to set the value of serve_static_assets_in_production to true (to make images and CSS files show correctly). Otherwise leave it as it is.
- Install Sphinx. Version 0.9.9 is recommended now as we haven’t tested Sharetribe with newer ones. See Sphinx installation instructions. (no need to start it yet. You can try running
searchd
command, but it should fail at this point complaining about missing config) - Install Imagemagick
- You can install optional Memcached if you want to enable faster caching in production environment.
- You may have more success installing the mysql2 gem manually at this point, particularly on Mac OS X
gem install mysql2 -v 0.2.7
- run
bundle install
in the project root directory (sharetribe) to install required gems - (In the following commands, leave out the
RAILS_ENV=production
part if you want to get Sharetribe running in development mode.) Load the database structure to your database:rake RAILS_ENV=production db:schema:load
- run sphinx index
rake RAILS_ENV=production thinking_sphinx:index
- start sphinx daemon
rake RAILS_ENV=production thinking_sphinx:start
- If you want to enable Sharetribe to send email locally (in the development environment), you might want to change the email settings in the config file. There is an example of configuring settings using a gmail account, but you can also use any other SMTP server. If you do not touch the settings, the development version works otherwise normally but might crash in instances where it tries to send email (like when sending a message to another user).
- Invoke the delayed job worker on your local machine:
rake RAILS_ENV=production jobs:work
. The worker processes tasks that are done in the background, like sending email notifications and assigning badges to people. - Start the server. There are many options for this, lately we have been using Passenger, but the simplest way is to use command
rails server
which will start it on Webrick, that is good option for development use.- To start the server in production environment, use command
rails server -e production
- To start the server in production environment, use command
- Sharetribe server can serve multiple Sharetribe communities (tribes) that are separated by subdomains. You need at least one community to use Sharetribe. The current logic with subdomains is that www shows the frontpage which can be used to create new communities, and other subdomains are reserved for those communities. To create a community, go to www.yourdomain.com (or www.lvh.me:3000 if you are running on your local machine with the default port 3000.) Follow the instructions to create a community. After that you can access it with the subdomain selected.
- The core team is doing development on macs and running servers on linux, so we don’t have experience on running Sharetribe on Windows. It is possible, but with guidance you might have to rely on the community support.
- There is a (bit outdated) separate guide for windows installation written by vbtdung
- Note that the installation instructions on this page are written for *nix-based systems so you need to change the commands a little to make them work in windows (e.g.
cp
becomescopy
in windows) - You may need to add few windows specific gems to Gemfile. Versions prior to 2.3.0 included these, but because they caused trouble running Sharetribe on Heroku, we decided to remove them from the default Gemfile. You can just add these lines to Gemfile and run “bundle install”.
gem 'win32console', :platforms => [:mswin, :mingw]
gem 'win32-process', :platforms => [:mswin, :mingw]
- If you are using MySQL, please note that Mac OS X 10.6 requires a 64-bit version of MySQL.
- Paths and mysql-libs can cause problems with sphinx. At one computer running OS X we tried all kinds of trick to let sphinx know where the mysql libraries are, but none of them fixed the issue. The final and working method was to copy the missing library file directly to the project directory.. :D
Most of the management operations need to be done in the Rails console.Admin of Sharetribe server page contains some help for that.
If you want to see what is currently being done by the core development team, you can take a look at the Pivotal Tracker
We also recommend to join the Sharetribe Development Flowdock where you can get the fastest answers for your questions and get to know the other developers. (If you prefer using IRC client for dev chat, that’s possible too after you create a Flowdock account)
- Install git: instructions
- If you are a collaborator with push rights to main repo, see Collaborator guide otherwise fork the project.
- Check git instructions if needed from: learn.github.com
- Run all tests and make sure they all pass. (see bottom of the Coding Guidelines page for details.)
- If you are a collaborator pushing directly to main repo, you must use Git Flow type of branching . We recommend installing and using Git Flow in any case as it makes it very simple to follow good branching logic.
- Make changes to the code in a feature branch and do tests for your features. See our Coding Guidelines if you need guidance in this!
- Make sure the old and new tests pass.
- Commiting changes with informative english commit message that explains the changes you’ve made. This article gives nice example of how to format commit comments.
- if you are a collaborator, you can push directly, if you set the ssh-key on your profile
- otherwise make a push to your own forked repository and if you thing that the commit would be useful for the main Sharetribe branch, please make a pull request by clicking the “Pull request” button in your project or on the page of your commit. This github guide explains forking nicely.