Content
[Solved] Heroku Development Recipe
Added by Ziyan Junaideen over 10 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)
Here’s what worked for me.
Clone OpenProject repo:
Go into project directory and checkout stable branch:
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):
Fire up your text editor and make the following file updates and additions.
Edit config/environments/production.rb as follows:
Create database.yml file in /config folder (this example is for Postgres):
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:
Get it running locally.
Create database user:
Run bundle tasks:
NEVER RUN bundle update! (this screwed things up for me)
Start up 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:
Set secret token:
Install the Postgres add-on:
Push project to Heroku:
It takes long time to bundle, pray for no error messages.
Run database migrations:
Run database seed:
Go to http://your_app_name.herokuapp.com
Hopefully it works!
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 thehost
property for all the databasesProcfile
Edit the file
Procfile
and pay attention to theweb:
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:Make sure to commit and push the changes! :-)
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.
We did it in a slightly different, concise way: http://www.imeos.com/blog/2015/03/18/deploy-openproject-to-heroku-the-easy-way/
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?