Giter Club home page Giter Club logo

sharetribe / sharetribe Goto Github PK

View Code? Open in Web Editor NEW
2.3K 164.0 1.3K 138.86 MB

Sharetribe Go is Sharetribe's old source-available marketplace software, which was also available as a hosted SaaS product. Sharetribe Go is no longer actively maintained.

Home Page: https://www.sharetribe.com

License: Other

Ruby 48.50% JavaScript 13.11% CSS 1.07% HTML 9.17% Shell 0.11% Gherkin 3.48% Dockerfile 0.05% SCSS 9.28% Haml 15.23% Procfile 0.01%
marketplace platform

sharetribe's Introduction

Sharetribe Go

CircleCI Code Climate

IMPORTANT: Sharetribe Go is no longer actively maintained.

Sharetribe's new marketplace builder, The New Sharetribe, replaces Sharetribe Go as the easiest, fastest way to build a marketplace. Learn more about what The New Sharetribe means for Sharetribe Go.

Sharetribe Go remains source-available under the Sharetribe Community Public License.

To build and launch a marketplace without writing a single line of code, and extend indefinitely with custom code and scale to any size, head to the SaaS version of The New Sharetribe.

Contents

Technology stack

  • Ruby 3.2.2
  • Ruby on Rails 6.1.7.3
  • MySQL 8.0
  • React + jQuery
  • Node.js 18.16 (for compiling JavaScript assets)
  • "what you see is what you get" Editor Mercury
  • Deploy: Custom Script (not using Mina or Cap3)
  • Server: Heroku
  • Image hosting: Amazon S3
  • Background job: delayed_job
  • Gems:
    • devise | Authentication
    • omniauth-facebook | Third party login: Facebook
    • haml and ERB | HTML templating
    • mysql2 | MySQL library for Ruby
    • paperclip | Image upload management
    • passenger | Web application server
    • react_on_rails | Integration of React + Webpack + Rails
    • factory_girl, capybara, rspec-rails, cucumber-rails, selenium-webdriver | Testing

Installation

Requirements

Before you get started, install the following:

  • Ruby. Version 3.2.2 is currently used and we don't guarantee everything works with other versions. If you need multiple versions of Ruby, RVM or rbenv is recommended.
  • RubyGems
  • Bundler: gem install bundler
  • Node. Version 18.16 is currently used and we don't guarantee everything works with other versions. If you need multiple versions of Node, consider using n, nvm, or nenv.
  • Git
  • A database. Only MySQL 8.0 has been tested, so we give no guarantees that other databases (e.g. PostgreSQL) work. You can install MySQL Community Server two ways:
    1. If you are on a Mac, use homebrew: brew install mysql (highly recommended). Also consider installing the MySQL Preference Pane to control MySQL startup and shutdown. It is packaged with the MySQL downloadable installer, but can be easily installed as a stand-alone.
    2. Download a MySQL installer from here
  • Sphinx. Version 2.1.4 has been used successfully, but newer versions should work as well. Make sure to enable MySQL support. If you're using OS X and have Homebrew installed, install it with brew install sphinx --with-mysql
  • Imagemagick. If you're using OS X and have Homebrew installed, install it with brew install imagemagick

Setting up the development environment

  1. Get the code. Clone this git repository and check out the latest release:

    git clone [email protected]:sharetribe/sharetribe.git
    cd sharetribe
    git checkout latest
  2. Install the required gems by running the following command in the project root directory:

    bundle install

    Note: libv8 might fail to build with Clang 7.3, in that case you can try installing V8 manually:

    brew tap homebrew/versions
    brew install v8-315
    
    gem install libv8 -v '3.16.14.13' -- --with-system-v8
    gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
    
    bundle install
  3. Install node modules:

    npm install && ( cd client && npm install )
  4. Create a database.yml file by copying the example database configuration:

    cp config/database.example.yml config/database.yml
  5. Add your database configuration details to config/database.yml. You will probably only need to fill in the password for the database(s).

  6. Create a config.yml file by copying the example configuration file:

    cp config/config.example.yml config/config.yml
  7. Create and initialize the database:

    bundle exec rake db:create db:structure:load
  8. Run Sphinx index:

    bundle exec rake ts:index

    Note: If your MySQL server is configured for SSL, update the config/thinking_sphinx.yml file and uncomment the mysql_ssl_ca lines. Configure correct SSL certificate chain for connection to your database over SSL.

  9. Start the Sphinx daemon:

    bundle exec rake ts:start
  10. Start the development server:

    foreman start -f Procfile.static
  11. Invoke the delayed job worker in a new console (open the project root folder):

    bundle exec rake jobs:work

Congratulations! Sharetribe should now be up and running for development purposes. Open a browser and go to the server URL (e.g. http://lvh.me:3000 or http://lvh.me:5000). Fill in the form to create a new marketplace and admin user. You should be now able to access your marketplace and modify it from the admin area.

Mailcatcher

Use Mailcatcher to receive sent emails locally:

  1. Install Mailcatcher:

    gem install mailcatcher
  2. Start it:

    mailcatcher
  3. Add the following lines to config/config.yml:

    development:
      mail_delivery_method: smtp
      smtp_email_address: "localhost"
      smtp_email_port: 1025
  4. Open http://localhost:1080 in your browser

Database migrations

To update your local database schema to the newest version, run database migrations with:

bundle exec rake db:migrate

Running tests

Tests are handled by RSpec for unit tests and Cucumber for acceptance tests.

Install the following extra dependencies:

  • Chromedriver. Make sure to install a driver version that matches your browser's.

Remember to follow all the steps listed in the Setting up the development environment paragraph before running tests because some tests depend on webpack assets.

  1. Navigate to the root directory of the sharetribe project

  2. Initialize your test database:

    bundle exec rake test:prepare

    This needs to be rerun whenever you make changes to your database schema.

  3. If Zeus isn't running, start it:

    zeus start
  4. To run unit tests, open another terminal and run:

    zeus rspec spec
  5. To run acceptance tests, open another terminal and run:

    zeus cucumber

    Note that running acceptance tests is slow and may take a long time to complete.

To automatically run unit tests when code is changed, start Guard:

bundle exec guard

Working with React, Webpack and Foreman

Some components are created with React (see documentation) and they need to be built with Webpack. We have Foreman Procfiles that can be used to run both Rails and Webpack:

  1. React component static build

    foreman start -f Procfile.static
  2. React component & hot loading styleguide (http://localhost:9001/)

    foreman start -f Procfile.hot
  3. If you need to debug the Rails parts of Sharetribe with Pry, it's not possible with Foreman due to a known compatibility issue. In this case we recommend running Rails with old-fashioned rails server and React builds with Foreman in a separate terminal. That way your binding.pry calls open nicely in the same window with the Rails process.

  4. React component static build, React client only

    foreman start -f Procfile.client-static
  5. React component & hot loading styleguide (http://localhost:9001/), React client only

    foreman start -f Procfile.client-hot

Setting up Sharetribe for production

Before starting these steps, perform steps 1-5 from above.

  1. Set secret_key_base

    Generate secret key

    rake secret

    Add the following lines to config/config.yml:

    production:
      secret_key_base: # add here the generated key

    (You can also set the secret_key_base environment variable, if you don't want to store the secret key in a file)

  2. Create the database:

    RAILS_ENV=production bundle exec rake db:create
  3. Initialize your database:

    RAILS_ENV=production bundle exec rake db:structure:load
  4. Run Sphinx index:

    RAILS_ENV=production bundle exec rake ts:index
  5. Start the Sphinx daemon:

    RAILS_ENV=production bundle exec rake ts:start
  6. Precompile the assets:

    RAILS_ENV=production NODE_ENV=production bundle exec rake assets:precompile
  7. Invoke the delayed job worker:

    RAILS_ENV=production bundle exec rake jobs:work
  8. In a new console, open the project root folder and start the server:

    bundle exec rails server -e production

The built-in WEBrick server (which was started in the last step above) should not be used in production due to performance reasons. A dedicated HTTP server such as unicorn is recommended.

It is not recommended to serve static assets from a Rails server in production. Instead, you should use a CDN (Content Delivery Network) service, such as Amazon CloudFront. To serve the assets from the CDN service, you need to change the asset_host configuration in the the config/config.yml file to point your CDN distribution.

You need to configure a couple scheduled tasks in order to properly run your marketplace in production. See the Scheduled tasks documentation.

For production use we recommend you to upgrade only when new version is released and not to follow the master branch.

Setting your domain

  1. In your database, change the value of the domain column in the communities table to match the hostname of your domain. For example, if the URL for your marketplace is http://mymarketplace.myhosting.com, then the domain is mymarketplace.myhosting.com.

  2. Change the value of the use_domain column to true (or 1) in the communities table.

  3. If you wish to enable HTTP Strict Transport Security (recommended), set also the hsts_max_age column in communities table to a non-zero number of seconds. For instance 31536000 (1 year).

Setting up S3

If you want to use S3 to host your images, you need to do a bit more configuration.

  1. Create a IAM role which has full S3 access. Save the AWS access and secret keys.

  2. In the S3 console, create two buckets, one for upload and one for permanent storage. For example your-sharetribe-images and your-sharetribe-images-tmp.

  3. Set the upload bucket (your-sharetribe-images-tmp) to have an expiration (for example, of 14 days) using lifecycle management

  4. Enable CORS on the upload bucket.

  5. Set the following configuration in your sharetribe config.yml: s3_bucket_name: "your-sharetribe-images" s3_upload_bucket_name: "your-sharetribe-images-tmp"

  6. Add your AWS keys to the sharetribe app. The best way to do that is via environment variables, rather than checking them into your config.yml. Set the aws_access_key_id and aws_secret_access_key environment variables to the values for the IAM user.

  7. (Optional) When you enable S3, uploaded images are linked directly to the S3 bucket. If you want to serve these assets through CDN, you can set the user_asset_host configuration option in addition to asset_host in config/config.yml.

Here's a sample CORS configuration that allows anyone to post to your bucket. Note that you may want to lock down the origin host more tightly, depending on your needs.

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>
Troubleshooting S3 Setup
  • if you are having trouble uploading, look at the request using browser devtools and see what error statuses and messages are being sent.
  • double check that your AWS keys are being correctly set.
  • if you can upload images successfully, but the images aren't processed, make sure that the delayed-job worker is running.

Advanced settings

Default configuration settings are stored in config/config.default.yml. If you need to change these, use the config/config.yml file to override the defaults. You can also set configuration values to environment variables.

React components can be created using hot module replacement HMR technique in Styleguide (http://localhost:9001/) path in local development environment. Webpack is used to bundle React components for deployments and hot loading. Related webpack configs can be found from folder sharetribe/client/

Unofficial installation instructions

Use these instructions to set up and deploy Sharetribe for production in different environments. They have been put together by the developer community, and are not officially maintained by the Sharetribe core team. The instructions might be somewhat out of date.

If you have installation instructions that you would like to share, don't hesitate to share them at the Sharetribe Go community forum.

Payments

PayPal and Stripe are the two available payment gateways integrated.

PayPal payments are only available on marketplaces hosted at Sharetribe.com due to special permissions needed from PayPal. We hope to add support for PayPal payments to the source available version of Sharetribe Go in the future.

Stripe can be used in the source available version, as long as your country and currency are supported.

Enable Stripe

Starting from release 7.2.0, Stripe is supported.

Stripe API keys will be encrypted when stored so it is important to configure your own random encryption key. You should fill the app_encryption_key variable in the config/config.yml file with a long random string, unique to your project.

Stripe can be configured from the admin panel, in the "Payment settings" section. Instructions on how to get Stripe API keys can be found there.

If Stripe isn't automatically enabled in the admin panel after upgrading to 7.2.0, you should run the following commands in your Rails console, where <ID> is your marketplace ID (probably 1): TransactionService::API::Api.processes.create(community_id: <ID>, process: :preauthorize, author_is_seller: true) and TransactionService::API::Api.settings.provision(community_id: <ID>, payment_gateway: :stripe, payment_process: :preauthorize, active: true).

Custom Landing Page

Sharetribe Go includes a Custom Landing Page add-on and editor. You can learn more about it here.

The Custom Landing Page Editor should be available automatically, from v9.1.0. If this is not the case, you can find plenty of useful information in the Landing Pages for Idiots Like Me post written by Jeremy D Evans.

Versioning

Sharetribe follows Semantic Versioning where possible.

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backwards-compatible manner, and
  • PATCH version when you make backwards-compatible bug fixes.

See the document How Sharetribe applies Semantic Versioning to read more how Semantic Versioning is applied in practice.

Changes

See CHANGELOG.md for detailed list of changes between releases.

Upgrade

See UPGRADE.md for information about actions needed when upgrading.

For production use we recommend you to upgrade only when new version is released and not to follow the master branch.

Contribute

Would you like to make Sharetribe better?

See CONTRIBUTING.md for the steps to contribute.

Release

See RELEASE.md for information about how to make a new release.

Translation

Translations are available through YAML files in the /config/locales folder.

Bug tracker

Browse open issues and submit new ones in Github Issues.

We are dedicating the Github Issue only for bugs in the Sharetribe Go codebase. For general questions, start a new thread in the Sharetribe Go Community forum instead of opening a new Issue.

After you have opened a new issue, the team will handle it according to these instructions: How to handle Github Issues.

Documentation

More detailed technical documentation is located in docs/

Sharetribe Go Community forum

The Sharetribe Go Community forum is located at https://www.sharetribe.com/community/.

The forum is a great place to ask support and help regarding Sharetribe Go Community Edition, for example with issues during the installation.

License

Sharetribe Go is source-available under the Sharetribe Community Public License. See LICENSE for details.

sharetribe's People

Contributors

aivils avatar bingxie avatar bladealslayer avatar charly3x avatar dependabot[bot] avatar github-actions[bot] avatar gnito avatar gnomet avatar jpsrn avatar kingakoterska avatar kpuputti avatar kride avatar kusti avatar luis-rg avatar lyyder avatar madumlao avatar mporkola avatar nikolailv avatar ovan avatar patricia-3 avatar rap1ds avatar schwerbelastung avatar sharetribe-apps avatar sktoiva avatar thomas-rocca avatar thomasmalbaux avatar tlsalmin avatar valdis avatar villesundberg avatar vsaarinen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sharetribe's Issues

NoMethodError in Api/listings#show

commit c2d7b2b

AFTER CREATING AN OFFER WITH WEB INTERFACE

Showing /home/dev/sharetribe/app/views/listings/show.haml where line #84 raised:

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]

Extracted source (around line #84):

81:         = facebook_like(current_user?(@listing.author))
82:       = link_to("", "https://twitter.com/share", :class => "twitter-share-button", "data-count" => "horizontal", "data-via" => "Sharetribe", "data-related" => "avoinyritys:Our company blog.")
83:       %script{:type => "text/javascript", :src => "https://platform.twitter.com/widgets.js"}    
84:       - if @current_community.settings["use_qr_code"]
85:         = link_to(t(".qr_code"), "http://qrcode.kaywa.com/img.php?s=6&d=#{CGI.escape request.url}", :target => '_blank')
86:     - if @listing.origin_loc && @listing.origin_loc.address != "" 
87:       #googlemap

TRYING IN RAILS CONSOLE

Community.first.settings
=> nil

Display reviews in listing page

If marketplace has testimonials enabled, we should show them on the listing page. Currently, we are showing them on the profile page only.

The text should be e.g. "Reviews: 80% positive (4/5)"

Screenshots

screen shot 2014-06-11 at 20 26 06

screen shot 2014-06-11 at 20 30 02

assets:precompile fails when executing installation instructions

When running ''rake assets::precompile", the following error occurs:

sharetribe@sharetribe:~/sharetribe$ rake assets:precompile
Digest::Digest is deprecated; use Digest
/home/sharetribe/.rvm/rubies/ruby-2.1.1/bin/ruby /home/sharetribe/.rvm/gems/ruby-2.1.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
Digest::Digest is deprecated; use Digest
AssetSync: using default configuration from built-in initializer
Digest::Digest is deprecated; use Digest
AssetSync: using default configuration from built-in initializer
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
AssetSync::Config::Invalid: Fog provider can't be blank, Fog directory can't be blank
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/asset_sync-1.0.0/lib/asset_sync/asset_sync.rb:48:in `with_config'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/asset_sync-1.0.0/lib/asset_sync/asset_sync.rb:28:in `sync'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/asset_sync-1.0.0/lib/tasks/asset_sync.rake:5:in `block (2 levels) in <top (required)>'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/asset_sync-1.0.0/lib/tasks/asset_sync.rake:20:in `block in <top (required)>'
Tasks: TOP => assets:sync
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/sharetribe/.rvm/rubies/ruby-2.1.1/bi...]
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/sharetribe/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/home/sharetribe/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

The installation was done on a freshly installed Ubuntu 12.04 system.

Changing cover image on marketplace (production environment) crashes site

After the following actions

  • Create a marketplace
  • Change cover image
    the "Page loading failed!" page showed up.

Any other actions (even after restarting the worker process and rails server) resulted in below error message:

sharetribe@sharetribe:~/sharetribe$ rails server -e production
=> Booting WEBrick
=> Rails 3.2.17 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
[2014-05-31 19:39:00] INFO  WEBrick 1.3.1
[2014-05-31 19:39:00] INFO  ruby 2.1.1 (2014-02-24) [i686-linux]
[2014-05-31 19:39:00] INFO  WEBrick::HTTPServer#start: pid=3646 port=3000
127.0.0.1:11211 failed (count: 0)
DalliError: No server available
Started GET "/" for 10.0.2.2 at 2014-05-31 19:39:02 +0200
Processing by HomepageController#index as 
  Rendered homepage/_search_bar.haml (2.2ms)
127.0.0.1:11211 failed (count: 1)
127.0.0.1:11211 is down
DalliError: No server available
DalliError: No server available
  Rendered layouts/_grid_item_listing_image.haml (28.8ms)
  Rendered layouts/_grid_item_listing_image.haml (4.0ms)
  Rendered homepage/_grid_item.haml (39.4ms)
  Rendered homepage/index.haml within layouts/application (4207.7ms)
  Rendered layouts/_kissmetrics.haml (3.8ms)
  Rendered layouts/_marketplace_head.haml (18.2ms)
  Rendered layouts/_head.haml (28.3ms)
Completed 500 Internal Server Error in 4585.9ms
10.0.2.2 GET / 500 Internal Server Error HomepageController#index HTML 4585.9 (DB 0.0, View 0.0) {} {}
** [Airbrake] Failure: Net::HTTPUnauthorized

ActionView::Template::Error (custom-style-outdoorsharing-20140531192617.css isn't precompiled):
    60: 
    61: / CSS
    62: - with_stylesheet_url(@current_community) do |stylesheet_url|
    63:   = stylesheet_link_tag stylesheet_url
    64: 
    65: / Modernizr, in the head tag, right after stylesheets, for best performance:
    66: = javascript_include_tag "modernizr.min"
  app/views/layouts/_marketplace_head.haml:63:in `block in _app_views_layouts__marketplace_head_haml___606783942__642222748'
  app/helpers/application_helper.rb:918:in `call'
  app/helpers/application_helper.rb:918:in `with_stylesheet_url'
  app/views/layouts/_marketplace_head.haml:62:in `_app_views_layouts__marketplace_head_haml___606783942__642222748'
  app/views/layouts/_head.haml:23:in `_app_views_layouts__head_haml___211716141__641277128'
  app/views/layouts/application.haml:1:in `_app_views_layouts_application_haml__582200595_109623380'
  config/initializers/oneline_detailed_logging.rb:31:in `block (2 levels) in <top (required)>'
  config/initializers/oneline_detailed_logging.rb:30:in `block in <top (required)>'
  lib/rack_middleware/custom_domain_cookie.rb:20:in `call'

It seems that something is not precompiled, but after a

rake assets:precompile

and restarting the worker process and rails server, still only the "Page loading failed!" page (with above error message on the console).

problems with UUIDs

on a VPS i use current way of getting UUIDs didn't work, to get it working i made changes:

# /app/models/person.rb

   before_validation(:on => :create) do
-    self.id = UUID.timestamp_create.to_s22
+    self.id = UUIDTools::UUID.random_create.to_s
   end

also had some problems with limit of 22 characters for this string and changing it in schema.rb for 36 solved it for me... and this part i find most tricky for existing systems, why did you choose to make UUIDs a pseudo UUIDs and limit them to 22 characters? would like to talk it over before merging changes to develop branch and making pull request!

unable to run rails s after install

Hi,

I followed the installation instructions however I'm not able to kick off the rails server. and after updating my .rb files to not include config.whiny_nils and calling rails server again the warnings are no longer there but it auto shuts down.

I'm using sqlite 3 with rails 4.0.0 and ruby 2.0.0 on ubuntu 12.04. I'd greatly appreciate any help!

@ubuntu:~/Desktop/sharetribe$ rails server
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server
DEPRECATION WARNING: config.whiny_nils option is deprecated and no longer works. (called from block in <top (required)> at /home/tiff/Desktop/sharetribe/config/environments/development.rb:16)
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

  • development - set it to false
  • test - set it to false (unless you use a tool that preloads your test environment)
  • production - set it to true
    DEPRECATION WARNING: Model based mass assignment security has been extracted
    out of Rails into a gem. Please use the new recommended protection model for
    params or add protected_attributes to your Gemfile to use the old one.

To disable this message remove the whitelist_attributes option from your
config/application.rb file and any mass_assignment_sanitizer options
from your config/environments/*.rb files.

See http://guides.rubyonrails.org/security.html#mass-assignment for more information.

DEPRECATION WARNING: The Active Record auto explain feature has been removed.

To disable this message remove the active_record.auto_explain_threshold_in_seconds
option from the config/environments/*.rb config file.

See http://guides.rubyonrails.org/4_0_release_notes.html for more information.

Exiting
/home/usr/.rvm/gems/ruby-2.0.0-p247/gems/activemodel-4.0.0/lib/active_model/validations/format.rb:46:in check_options_validity': The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \A and \z, or forgot to add the :multiline => true option? (ArgumentError) from /home/usr/.rvm/gems/ruby-2.0.0-p247/gems/activemodel-4.0.0/lib/active_model/validations/format.rb:20:incheck_validity!'
from /home/usr/.rvm/gems/ruby-2.0.0-p247/gems/activemodel-4.0.0/lib/active_model/validator.rb:143:in initialize' from /home/usr/.rvm/gems/ruby-2.0.0-p247/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:87:innew'
from /home/usr/.rvm/gems/ruby-2.0.0-p247/gems/activemodel-4.0.0/lib/active_model/validations/with.rb:87:in `block in validates_with'

replace gem memcache-client with dalli

https://github.com/mperham/memcache-client says
"memcache-client is deprecated as of August 2010. It will be supported through 2010 but new code should use Dalli instead."

and points to: https://github.com/mperham/dalli
"is approximately 20% faster than memcache-client (which itself was heavily optimized) in Ruby 1.9.2."

"Dalli has no runtime dependencies and never will. You can optionally install the 'kgio' gem to give Dalli a 20-30% performance boost."

i will not try to replace it myself since don't know at this moment how to test it...

support for PostgreSQL

it looks like at this moment schema doesn't load if I try using PostgreSQL...

$ rake db:schema:load
...
-- add_index("communities_listings", ["listing_id", "community_id"], {:name=>"communities_listings"})
rake aborted!
PG::Error: ERROR:  relation "communities_listings" already exists

any strategic reason for not supporting databases other than MySQL?

Migrations problem

Hi,

I've just clone the project and i am trying to make it work on my VPS.
When running migrations, i am having some problems:

== AddDefaultGradeToExistingPersonComments: migrating ========================
rake aborted!
An error has occurred, all later migrations canceled:
uninitialized constant AddDefaultGradeToExistingPersonComments::PersonComment
/var/deploy/sharetribe/web_head/releases/20140225023003/db/migrate/20090731134028_add_default_grade_to_existing_person_comments.rb:3:in `up'

Gherkin installation fails in "bundle install"

Maybe I should post this in the gherkin issue tracker ?

Installing gherkin (2.1.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.8 extconf.rb 

checking for main() in -lc... yes
creating Makefile

make
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -O0 -Wall -Werror -c gherkin_lexer_ar.c
/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/ar.c.rl: In function ‘CLexer_scan’:
/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/ar.c.rl:198:29: error: the comparison will always evaluate as ‘true’ for the address of ‘raise_lexer_error’ will never be NULL [-Werror=address]
/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/ar.c.rl:198:29: error: the comparison will always evaluate as ‘true’ for the address of ‘raise_lexer_error’ will never be NULL [-Werror=address]
cc1: all warnings being treated as errors
make: *** [gherkin_lexer_ar.o] Error 1

Gem files will remain installed in /var/lib/gems/1.8/gems/gherkin-2.1.5 for inspection.
Results logged to /var/lib/gems/1.8/gems/gherkin-2.1.5/ext/gherkin_lexer_ar/gem_make.out
An error occured while installing gherkin (2.1.5), and Bundler cannot continue.
Make sure that gem install gherkin -v '2.1.5' succeeds before bundling.

Am using Ubuntu 12.04 precise if anything is missing...

cleanup (prune) old branches

i would recommend to keep in sharetribe/sharetribe repo only branches of everyone's interest, still on forks everyone can keep all kind of stuff for one's own convenience. many of current branches seam to me like a good candidates to delete them from this main repo here.

we were also talking earlier with @gnomet on irc about git branching workflow, here i would suggest sticking to gitflow: https://github.com/nvie/gitflow which provides as bonus nice CLI and "On the path with git-flow" screencast which we can recommend as introduction for new contributors

in case above also switching default branch on github to develop would represent actual activity better, this would require mentioning in instructions for production installations checking out master

support for glocal tribes

we already use one glocal tribe for OuiShare and I would like to encourage people from few other communities to start such tribes as well. at this moment it looks like you assume all tribes sharing common locality. maybe with just few modifications we could enable glocal ones?

Problems with redirect

Hey, i am having some problems with internal redirect.

I have a sharetribe on my VPS, is already working at
subdomain.domain.com

But i try to do a redirect on Nginx
where this should happens:

domain.com should redirect(internally) to

subdomain.domain.com

The redirect works, but having problems with routes.

As you offer the sharetribe hosted solution, i think you know how to solve this.

As i said i am using NginX

Thanks a lot!

update gem dependencies

ok, i decided to make it a separate issue from #5 (updating to ruby 1.9.3) because i find current Gemfile a real roadblock for me to do anything else :( now it also takes over issue #3

when i add any new gem to Gemfile and run

$ bundle install

i get into a hell of error messages! starting from super cool:

Bundler could not find compatible versions for gem "bundler"

rubygems/bundler#2081

first it stopped me from adding 'thin' or 'unicorn' to setup instance in production and now i can't add i18n-js

i've started doing some work on it here: https://github.com/elf-pavlik/sharetribe/tree/feature/gems-update
but don't feel comfortable moving to far since i never had specs & cukes passing

maybe we could try to do our best with 1.8 to get tests passing and make it possible to add new gems and then we can make second step with updating to 1.9.3 ?

setup translation project on transifex.com

i started setting up a sharetribe instance for occupy.net network, i guess people would like to translate it to their native languages :)

I already have setup a project for bettermeans on https://www.transifex.com which I find the most nice to use platform running itself an open source codebase. I would like that people could learn it's interface and than contribute to all kind of projects which host their translations over there... What do you think about setting up sharetribe project over there?

I hope that many tribes could appear soon: http://directory.occupy.net/ (>1500 occupations worldwide) :D

Undefined method 'locale'

Hello,

In the 'thanks for your interest' page where you select where you come from, after hitting the send button, i'm getting undefined method error

NoMethodError in ContactRequestsController#update

undefined method `locale' for nil:NilClass

Application Trace | Framework Trace | Full Trace
app/mailers/person_mailer.rb:300:in reply_to_contact_request' app/controllers/contact_requests_controller.rb:15:inupdate'
config/initializers/oneline_detailed_logging.rb:32:in block (2 levels) in <top (required)>' config/initializers/oneline_detailed_logging.rb:31:inblock in <top (required)>'
lib/rack_middleware/custom_domain_cookie.rb:20:in `call'

In the person_mailer.rb file, the set_locale @country_manager.locale is not recognizing the method.

def reply_to_contact_request(contact_request)
@contact_request = contact_request
@country_manager = CountryManager.find_by_country(@contact_request.country) || CountryManager.find_by_country("global")
#@country_manager ||= CountryManager.find_by_country("global")
set_locale @country_manager.locale
email_from = "#{@country_manager.given_name} #{@country_manager.family_name} <#{@country_manager.email}>"
mail(:to => @contact_request.email, :subject => @country_manager.subject_line, :from => email_from) do |format|
format.html { render :layout => false }
end

Reopening issue #411

New issue created because I don't have rights to reopen it:

The proposed solution for #411 to pull in the newest version does change the error slightly, but in the end the same error still occurs.

The full error message is:

sharetribe@sharetribe:~/sharetribe$ rake assets:precompile
Digest::Digest is deprecated; use Digest
/home/sharetribe/.rvm/rubies/ruby-2.1.1/bin/ruby /home/sharetribe/.rvm/gems/ruby-2.1.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
Digest::Digest is deprecated; use Digest
AssetSync: using /home/sharetribe/sharetribe/config/initializers/asset_sync.rb
AssetSync enabled: true
Digest::Digest is deprecated; use Digest
AssetSync: using /home/sharetribe/sharetribe/config/initializers/asset_sync.rb
AssetSync enabled: true
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
rake aborted!
AssetSync::Config::Invalid: Fog provider can't be blank, Fog directory can't be blank
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/asset_sync-1.0.0/lib/asset_sync/asset_sync.rb:48:in `with_config'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/asset_sync-1.0.0/lib/asset_sync/asset_sync.rb:28:in `sync'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/asset_sync-1.0.0/lib/tasks/asset_sync.rake:5:in `block (2 levels) in <top (required)>'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/asset_sync-1.0.0/lib/tasks/asset_sync.rake:20:in `block in <top (required)>'
Tasks: TOP => assets:sync
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/sharetribe/.rvm/rubies/ruby-2.1.1/bi...]
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/home/sharetribe/.rvm/gems/ruby-2.1.1/gems/actionpack-3.2.17/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/home/sharetribe/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/home/sharetribe/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

It differs from the previous error only on the AssetSync:... lines, the rest of the error is the same.

add plain text version of system emails

at this moment i mostly use terminal based mail client and find it an extra effort to deal with html only messages...

i can try looking up how to add plain text, i remember RoR should make it rather easy :)

ReferenceError: Typekit is not defined

Hi guys - I was just browsing around on Sharetribe and I get a pop-up with this warning whenever viewing a tribe. My guess based on this (http://stackoverflow.com/questions/8720335/why-do-i-get-an-uncaught-referenceerror-is-not-defined-anonymous-function) is that Typekit isn't finished loading when you call Typekit.load()

<script src="//use.typekit.net/wja3pck.js" type="text/javascript"></script>
<script>
   //<![CDATA[
    try{Typekit.load();}catch(e){
      alert(e);
    }
  //]]>
</script>

:domain_redirect filter sending me to sharetribe.com

i had some problems with my setup using virtual machines and made fast one directly on my OS
somehow i ended up getting redirected sometimes to sharetribe.com domain, i must say that i don't fully understand this issue and just wanted to add it to tracker here :)

Started GET "/" for 127.0.0.1 at 2012-12-14 15:03:25 +0100
Processing by HomepageController#index as */*
Redirected to http://testing.sharetribe.com/
Filter chain halted as :domain_redirect rendered or redirected
Completed 302 Found in 0ms (ActiveRecord: 0.0ms)

while requesting testing.sharetribe. dev which i configured in my /etc/hosts

maybe all the logic you have in this filter could go to sharetribe.com branch and later other stuff specific to that instance could also stay there?

move custom code out of "features/support/env.rb"

$ git log features/support/env.rb

shows list of custom edits while top of the file reads:

# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a.
# newer version of cucumber-rails. Consider adding your own code to a new file.
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.

bumped on it while updating gems and running as recommended:

rails g cucumber:install

Possibility to export personal data and import that in other instance

This has been wished. (e.g. https://twitter.com/konradfoerstner/status/287551667904344064)

Not yet scheduled for dev by core team, but if some one is interested to take a look at this, feel free.

We probably would do the personal data export first and then later the possibility to import that on a server. That way it would also make moving data between servers easier.

If someone needs help moving data between servers before that, you can contact me for help.

move to ruby 1.9.3

i see you suggest ruby 1.8 i started setting up development with ree-1.8.7 (using rbenv) which allowed me to start server, then in production adding thin or unicorn to gemfile put me it some crazy trip with bundler and gem dependencies :(

i would like to first get all specs and cukes to pass on my dev setup and then see how it goes with running on 1.9.3 do you have some xp with it already?

Community css

Hi,

I installed a sharetribe on a VPS, when i change the look and feel the community, i'm getting an error, probably because of the css.

How can i avoid this? Is it possible to generate css automatically?
Or i have to run the rake task when something is changed?

thanks

schema.org integration

related: #24 #12 #21

http://schema.org - collaboration among Google, Yahoo, Bing, Yandex with involvement of people working with W3C

It provides vocabulary which search engines mentioned above recognize, so that we can express information about all kind of things in common terms. I also improves how pages show in search results supporting Rich Snippets for Structured Data as explained in: http://googlewebmastercentral.blogspot.co.at/2009/05/introducing-rich-snippets.html

Ruby has already great support for all the technologies which schema.org builds upon: http://ruby-rdf.github.io

@gnomet I hope you remember experiments during OuiShare Labs camp in Paris and our discussions in a park about JSON-LD and its graceful use of @context allowing easy upgrade path for existing JSON based APIs 😄

I will do my best to work on a PR for this issue but also encourage everyone interested in checkout out following types and their *sub-types

Plus relevant properties for types Person and Organization (I suggested also allowing some of them for in Event)

BTW since you already run one Jobs oriented tribe for OuiShare, we can experiment first with simpler case of:

You can also find nice listing of the whole tree at: http://schema.org/docs/full.html

Retina Images for Logo

Display 2x resolution images to users on Retina or high-DPI screens. Preferably for all images but especially for marketplace logo.

They look blurry on Retina screens otherwise:
screen shot 2014-04-24 at 12 58 12 pm

*communities* directory in app root?

most of its content looks sharetribe.com specific...

i see community_file helper used if few places, maybe we can look at moving that stuff to database and incorporate it into tribe admin interface?

Domain

I checkout the code, installed in a server, following the installation instructions. Had some issues, but are already solved.
My question is: is it possible to configure a sharetribe without a registered domain? only with the IP, we don't have a domain, just want to test.
Thanks

review Gemfile

just noticed that 2 gems have comments as not used

  • whenever
  • postmark-rails

i would also look at moving to test:

  • database_cleaner
  • rspec-rails

also we don't need

  • cucumber
    since cucumber-rails depends on it

for

  • passenger
    i could add documentation on how to configure nginx + unicorn

do you still use:

  • spreadsheet
    ?

Installing ruby on Ubuntu 14.04

There are several hurdles when installing on Ubuntu 14.04 with the given instructions for Ubuntu 12.10 on the site.

The following site gives an overview how to install ruby 2.1.1 with rails on Ubuntu 14.04:
https://gorails.com/setup/ubuntu/14.04

Incorporating this link in the installation instructions could help other users installing ruby and rails.

add support for oEmbed

from http://oembed.com
"oEmbed is a format for allowing an embedded representation of a URL on third party sites. The simple API allows a website to display embedded content (such as photos or videos) when a user posts a link to that resource, without having to parse the resource directly."

on can see it in action for example on twitter:

i think it may make it much cooler to share listings over other social networking platforms :)

Google Universal Analytics

Need support for Google's new Universal Analytics. Google has phased out the old Classic Analytics and there is not ability to create an Classic Analytics property anymore.

Installation instructions missing dependency (Ubuntu 14.04)

On Ubuntu 14.04 I ran

sudo gem install mysql2 -v 0.2.7

and got the following error:

ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (Load)
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from extconf.rb:2:in `<main>'

The issue was fixed by running:

sudo apt-get install ruby1.9.1-dev

Adding this to the installation instructions would add to a "smoother" installation experience.

Source of solution:
http://stackoverflow.com/questions/13767725/unable-to-install-gem-failed-to-build-gem-native-extension-cannot-load-such

sharetribe.org

folks from occupy.net just organized a wildcard SSL cert for their permabank.net domain where i plan to setup sharetribe for them. i started changing footer to just say: "powered by ShareTribe" and for now will link to github repo here. maybe good time to setup something simple for sharetribe.org? :)

Redirect loop problem

I start a sharetribe server in my VPS, i configure everything.
On my local machine is working ok, but in production mode i am getting a redirect loop problem at -

[ 2013-11-04 08:31:00.2289 32183/7f4604d94700 Pool2/Implementation.cpp:1274 ]: [App 32487 stdout] Started GET "/people/login" for 179.236.126.251 at 2013-11-04 08:31:00 -0500

Listings that are moved to the top are presented as new listings in weekly mail

Background

Marketplace admins are able to promote older listings by moving them to the top of the homepage. This is done by touching the created_at timestamp. Due to this hackish solution, the promoted listings are also on the weekly mail and they are presented as a new listings, even though they are not new.

Steps to reproduce

  1. Deliver community updates newsletter
  2. Log in as a marketplace admin
  3. Go to listing page
  4. Promote a listing by clicking "Move to top of the homepage" link
  5. Deliver community updates newsletter

Expected result:

The second newsletter contains only listings that are added AFTER the first newsletter, that is, there are no promoted listings.

Actual result:

The second newsletter contains promoted listings

Screenshots

screen shot 2014-06-11 at 20 07 15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.