Top Menu

Jump to content
Home
    • Projects
    • Work packages
    • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Professional support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?
      Create a new account

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
  • Roadmap
  • Work packages
  • Calendars
  • Team planners
  • Boards
  • Forums
  • Wiki
    • Table of contents
      • Expanded. Click to collapseCollapsed. Click to showDeveloper
        • Hierarchy leafAccessibility Checklist
        • Hierarchy leafCode Review Guidelines
        • Expanded. Click to collapseCollapsed. Click to showContribution
          • Hierarchy leafGit Workflow
          • Hierarchy leafTranslations
        • Expanded. Click to collapseCollapsed. Click to showDeveloping Plugins
          • Hierarchy leafDeveloping an OmniAuth Authentication Plugin
        • Hierarchy leafRelease Process
        • Hierarchy leafReport a bug
        • Hierarchy leafSecurity
        • Hierarchy leafSetting up an OpenLDAP server for testing
        • Hierarchy leafTheme Features
      • Hierarchy leafDownload
      • Expanded. Click to collapseCollapsed. Click to showFeature tour
        • Hierarchy leafRelease Notes OpenProject 30
        • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 30 - Overview
          • Hierarchy leafGlossary
          • Hierarchy leafRelease Notes - Accessibility
          • Hierarchy leafRelease Notes - Accessibility changes
          • Hierarchy leafRelease Notes - Add work package queries as menu items to sidebar
          • Hierarchy leafRelease Notes - Copy projects based on Templates
          • Hierarchy leafRelease Notes - Design changes
          • Hierarchy leafRelease Notes - Fixed Bugs
          • Hierarchy leafRelease Notes - Keyboard Shortcuts
          • Hierarchy leafRelease Notes - Project settings
          • Hierarchy leafRelease Notes - Ruby&Rails Update
          • Hierarchy leafRelease Notes - Security
          • Hierarchy leafRelease Notes - Timelines
          • Hierarchy leafRelease Notes - Work packages
      • Hierarchy leafHowto create animated gifs
      • Hierarchy leafMigration Squashing
      • Hierarchy leafMod security
      • Hierarchy leafNew work package page
      • Hierarchy leafOP3 to OP4 Debian upgrade
      • Hierarchy leafOP4 Ubuntu1404 Stable with MySQL in production
      • Hierarchy leafOpenProject 40 Development Setup
      • Expanded. Click to collapseCollapsed. Click to showOpenProject Foundation
        • Hierarchy leafBoards
        • Hierarchy leafMembers
        • Hierarchy leafOPF-Meetings
        • Hierarchy leafStatutes
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes
        • Hierarchy leafOpenProject released on Bitnami
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 40 - Overview
        • Hierarchy leafRelease Notes OpenProject 40 - Accessibility improvements
        • Hierarchy leafRelease Notes OpenProject 40 - Column header functions in work package table
        • Hierarchy leafRelease Notes OpenProject 40 - Improved Design
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated query title on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated toolbar on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - OmniAuth integration for OpenProject
        • Hierarchy leafRelease Notes OpenProject 40 - Work package details pane
      • Expanded. Click to collapseCollapsed. Click to showSecurity and privacy
        • Hierarchy leafFAQ
      • Expanded. Click to collapseCollapsed. Click to showSupport
        • Expanded. Click to collapseCollapsed. Click to showDownload and Installation
          • Hierarchy leafInstallation MacOS
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 3 0
            • Hierarchy leafDebian Stable with MySQL in production
            • Hierarchy leafInstallation Ubuntu
            • Hierarchy leafInstallation Windows
            • Hierarchy leafInstallation on Centos 65 x64 with Apache and PostgreSQL 93
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 40
            • Hierarchy leafOP4 Debian Stable with MySQL in production
          • Expanded. Click to collapseCollapsed. Click to showMigration paths
            • Hierarchy leafFrom Chilliproject to OpenProject
            • Hierarchy leafMigration 15 to 30
            • Hierarchy leafMigration 24 to 30
            • Hierarchy leafMigration Redmine 2x › OpenProject 30
            • Hierarchy leafOpenProject 3 Migration
          • Hierarchy leafOpenProject 40
        • Expanded. Click to collapseCollapsed. Click to showNews
          • Hierarchy leafNew OpenProject Translations Plugin
          • Hierarchy leafNew Plugin on OpenProjectorg Local Avatars
          • Hierarchy leafNew design for OpenProject
          • Hierarchy leafNews Accessibility workshop for OpenProject
          • Hierarchy leafNews Glossary for OpenProject
          • Hierarchy leafNews Heartbleed fixed
          • Hierarchy leafNews Icon Fonts
          • Hierarchy leafNews OpenProject 30 Release
          • Hierarchy leafNews Release GitHub Integration Plugin
          • Hierarchy leafNews Success Story Deutsche Telekom
          • Hierarchy leafNews Timelines
          • Hierarchy leafOpenProject 3013 released
          • Hierarchy leafOpenProject 3017 released
          • Hierarchy leafOpenProject 40 released
          • Hierarchy leafOpenProject 40 will be coming soon
          • Hierarchy leafOpenProject 405 released
          • Hierarchy leafOpenProject and pkgrio
          • Hierarchy leafOpenProject news moved to a new blog
          • Hierarchy leafOpenProjectBitnami
          • Hierarchy leafPackager version with plugins released ("Community edition")
          • Hierarchy leafRegistration OpenProject-Foundation
          • Hierarchy leafRelease OpenProject AuthPlugins
          • Hierarchy leafUpdates on OpenProject
          • Hierarchy leafWe need your feedback for the the new fullscreen view for work packages
        • Hierarchy leafOpenProject Plug-Ins
      • Expanded. Click to collapseCollapsed. Click to showWiki
        • Hierarchy leaf2nd Level Support
You are here:
  • Forums
  • General discussion

Content

[Solved] Heroku Development Recipe

Added by Ziyan Junaideen about 9 years ago

I am wondering if any one has a Heroku deployment recipe/steps that I can just follow and have success.

As per the moment, I think I will have to reorganize Gemfile in such a way that sqlite and others stay in development. Also it might be good idea to have a feature that can simply publish the application to Heroku for that matter as I have seen on OSCurrency project

@
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/tmp/build_4d057504-1fe1-4ea5-87f5-68df67ebd2f5/vendor/ruby-2.0.0/bin/ruby extconf.rb
checking for sqlite3.h… no
sqlite3.h is missing. Try ‘port install sqlite3 +universal’
or ‘yum install sqlite-devel’ and check your shared library search path (the
location where your sqlite3 shared library is located).
* extconf.rb failed*
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
—with-opt-dir
—without-opt-dir
—with-opt-include
—without-opt-include=${opt-dir}/include
—with-opt-lib
—without-opt-lib=${opt-dir}/lib
—with-make-prog
—without-make-prog
—srcdir=.
—curdir
—ruby=/tmp/build_4d057504-1fe1-4ea5-87f5-68df67ebd2f5/vendor/ruby-2.0.0/bin/ruby
—with-sqlite3-dir
—without-sqlite3-dir
—with-sqlite3-include
—without-sqlite3-include=${sqlite3-dir}/include
—with-sqlite3-lib
—without-sqlite3-lib=${sqlite3-dir}/
—enable-local
—disable-local

Gem files will remain installed in /tmp/build_4d057504-1fe1-4ea5-87f5-68df67ebd2f5/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7 for inspection.
Results logged to /tmp/build_4d057504-1fe1-4ea5-87f5-68df67ebd2f5/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.7/ext/sqlite3/gem_make.out
Installing sass (3.2.9)
Installing oj (2.1.6)
Installing syck (1.0.1)
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v ‘1.3.7’` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Detected sqlite3 gem which is not supported on Heroku.
! https://devcenter.heroku.com/articles/sqlite3
!

! Push rejected, failed to compile Ruby app
.@


Replies (5)

RE: Heroku Development Recipe - Added by Troy Burke over 8 years ago

Here’s what worked for me.

Clone OpenProject repo:

git clone https://github.com/opf/openproject.git your_app_name

Go into project directory and checkout stable branch:

cd your_app_name
git checkout stable

Create copy of stable branch (My thought here is that I do not want to make changes in the stable branch, so i can pull updates from remote and then merge them into my branch which I use to deploy to Heroku. I’m new to Git, so there may be a better approach):

git checkout -b your_branch_name origin/stable

Fire up your text editor and make the following file updates and additions.

Edit config/environments/production.rb as follows:

# Disable Rails's static asset server (Apache or nginx will already do this)
  #config.serve_static_assets = false
  config.serve_static_assets = true

Create database.yml file in /config folder (this example is for Postgres):

development:
  adapter: postgresql
  encoding: unicode
  database: your_app_name_development
  pool: 5
  username: your_app_name
  password:

test:
  adapter: postgresql
  encoding: unicode
  database: your_app_name_test
  pool: 5
  username: your_app_name
  password:

production:
  adapter: postgresql
  encoding: unicode
  database: your_app_name_production
  pool: 5
  username: your_app_name
  password:

Edit gemfile, remove non-postgres gem references (I also commented out the jruby block for good measure) and move gem ‘thin’ outside of development block:

#platforms :mri, :mingw do
#  group :mysql2 do
#    gem "mysql2", "~> 0.3.11"
#  end

#  group :postgres do
      gem 'pg', "~> 0.17.1"
#  end

#  group :sqlite do
#    gem "sqlite3"
#  end

group :development do
  gem 'letter_opener', '~> 1.0.0'
  gem 'rails-dev-tweaks', '~> 0.6.1'
#  gem 'thin'
  gem 'faker'
  gem 'quiet_assets'
end

gem 'thin'

Get it running locally.

Create database user:

create user "your_app_name" with superuser password '';

Run bundle tasks:

bundle install --without mysql mysql2 sqlite development test
bundle exec rake generate_secret_token
bundle exec rake db:create:all
bundle exec rake db:migrate db:seed RAILS_ENV=production
bundle exec rake assets:precompile

NEVER RUN bundle update! (this screwed things up for me)

Start up rails server:

RAILS_ENV=production bundle exec rails server

Go to localhost:3000 (site should be running) login is admin/admin.

Make sure to commit your changes.

Now the Heroku stuff.

Create new Heroku app:

heroku apps:create your_app_name

Set secret token:

heroku config:set SECRET_TOKEN=your_secret_token

Install the Postgres add-on:

heroku addons:add heroku-postgresql

Push project to Heroku:

git push heroku your_branch_name:master

It takes long time to bundle, pray for no error messages.

Run database migrations:

heroku run rake db:migrate

Run database seed:

heroku run rake db:seed

Go to http://your_app_name.herokuapp.com

Hopefully it works!

Missing steps - Added by Deleted user over 8 years ago

Your instructions are excelent Troy. But in my case, I have to make some changes to get it working:

Database

Don’t use the pool property and add the host property for all the databases

production:
  adapter: postgresql
  encoding: unicode
  database: psql_database
  host: localhost
  username: psql_user_name
  password: psql_user_pass

Procfile

Edit the file Procfile and pay attention to the web: line. It should match Heroku’s policies. In my case, commenting the default value and adding the correct value that Heroku provides. It should looks like this:

# web: bundle exec unicorn --config-file config/unicorn.rb --host ${HOST:="127.0.0.1"} --port ${PORT:="8080"} --env ${RAILS_ENV:="development"}
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
worker: bundle exec rake jobs:work
backup: ./packaging/scripts/backup
check: ./packaging/scripts/check

Make sure to commit and push the changes! :-)

RE: [Solved] Heroku Development Recipe - Added by Duarte Dias over 8 years ago

Hi all,

I just wanted to know. After you installed Open Project on Heroku, were you able to store files as anexes of the tasks? Or store any kind of file? My concern is that I had previous problems with saving uploaded files directly in the file system in heroku, in my previous experience something like paperclip should be necessary.
I want to know because this is crucial to my project. Im trying to deploy to heroku but I have not successed yet, I need to know if it will be worth it to try to push this heroku idea.
Thanks in advance and thanks for your instructions.

RE: [Solved] Heroku Development Recipe - Added by Chris Seelus about 8 years ago

We did it in a slightly different, concise way: http://www.imeos.com/blog/2015/03/18/deploy-openproject-to-heroku-the-easy-way/

RE: Heroku Development Recipe - Added by Shalahudin Ayyuby about 3 years ago

i got error

Installing nio4r 2.5.2 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:

C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2/ext/nio4r

C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r

./siteconf20200324-3460-1ejjszg.rb extconf.rb

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2/ext/nio4r

make "DESTDIR=" clean

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2/ext/nio4r

make "DESTDIR="

make failedNo such file or directory - make "DESTDIR="

Gem files will remain installed in

C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/nio4r-2.5.2 for inspection.

Results logged to

C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/nio4r-2.5.2/gem_make.out

An error occurred while installing nio4r (2.5.2), and Bundler cannot continue.

Make sure that `gem install nio4r -v '2.5.2' --source 'https://rubygems.org/'`

succeeds before bundling.

In Gemfile:

 openproject-openid_connect was resolved to 1.0.0, which depends on

   lobby_boy was resolved to 0.1.3, which depends on

     rails was resolved to 6.0.2.2, which depends on

       actioncable was resolved to 6.0.2.2, which depends on

         nio4r

how to fix this?

  • (1 - 5/5)
Loading...