I am trying to host a RoR app with Publify gem via heroku. However I keep getting the following error. I have followed the instructions on Publify's github page concerning heroku, https://github.com/publify/publify. Another interesting thing is that it runs perfectly on my own server (rails s), signalling that something is wrong with the environment in the gemfile.
Thanks in advance for your help.
Here are the errors I am receiving (heroku push) :
Your version of git is 1.9.3. Which has serious security vulnerabilities.
More information here: https://blog.heroku.com/archives/2014/12/23/update_your_git_clients_on_windows_and_os_x
Checking for app files to sync... done, 590 files needed
Uploading: 100.0% (ETA: 0s)
Launching build process... done
Preparing app for compilation... done
Fetching buildpack... done
Detecting buildpack... done, Buildkit+Ruby
Fetching cache... empty
Compiling app...
Compiling for Ruby
Compiling Ruby/Rails
sh: Syntax error: Unterminated quoted string
!
ERROR: There was an error parsing your Gemfile, we cannot continue
ERROR: Unfortunately, a fatal error has occurred. Please see the Bundler
ERROR: troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
ERROR: /tmp/compile_unHgf/Gemfile:19:in `eval_gemfile': You need to configure config/database.yml first (RuntimeError)
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/dsl.rb:36:in `instance_eval'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/dsl.rb:36:in `eval_gemfile'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/dsl.rb:10:in `evaluate'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/definition.rb:26:in `build'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler.rb:153:in `definition'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/cli/platform.rb:10:in `block in run'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/ui/shell.rb:69:in `silence'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/cli/platform.rb:9:in `run'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/cli.rb:358:in `platform'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/vendor/thor/command.rb:27:in `run'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/vendor/thor/base.rb:440:in `start'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/cli.rb:9:in `start'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/bin/bundle:20:in `block in <top (required)>'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/gems/bundler-1.6.3/bin/bundle:20:in `<top (required)>'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/bin/bundle:19:in `load'
ERROR: from /tmp/d20150118-87-1khnax5/bundler-1.6.3/bin/bundle:19:in `<main>'
!
ERROR: Build failed, exited 1
Since the problem has been caused by the gemfile here is mine,
source 'https://rubygems.org'
if ENV["HEROKU"]
ruby '2.1.3'
gem "pg"
gem "thin" # Change this to another web server if you want (ie. unicorn, passenger, puma...)
gem "rails_12factor"
else
require 'yaml'
env = ENV["RAILS_ENV"] || 'development'
dbfile = File.expand_path("../config/database.yml", __FILE__)
unless File.exists?(dbfile)
if ENV['DB']
FileUtils.cp "config/database.yml.#{ENV['DB'] || 'postgres'}", 'config/database.yml'
else
raise "You need to configure config/database.yml first"
end
end
conf = YAML.load(File.read(dbfile))
environment = conf[env]
adapter = environment['adapter'] if environment
raise "You need define an adapter in your database.yml or set your RAILS_ENV variable" if adapter == '' || adapter.nil?
case adapter
when 'sqlite3'
gem 'sqlite3'
when 'postgresql'
gem 'pg'
when 'mysql2'
gem 'mysql2'
else
raise "Don't know what gem to use for adapter #{adapter}"
end
end
gem 'rails', '~> 4.1.7'
gem 'htmlentities'
gem 'bluecloth', '~> 2.1'
gem 'coderay', '~> 1.1.0'
gem 'kaminari'
gem 'RedCloth', '~> 4.2.8'
gem 'addressable', '~> 2.1', :require => 'addressable/uri'
gem 'mini_magick', '~> 3.8.1', :require => 'mini_magick'
gem 'uuidtools', '~> 2.1.1'
gem 'flickraw-cached'
gem 'rubypants', '~> 0.2.0'
gem 'rake', '~> 10.3.2'
#gem 'acts_as_list'
#gem 'acts_as_tree_rails3'
gem 'fog'
gem 'recaptcha', :require => 'recaptcha/rails', :branch => 'rails3'
gem 'carrierwave', '~> 0.10.0'
gem 'akismet', '~> 1.0'
gem 'twitter', '~> 5.6.0'
gem "jquery-rails", "~> 3.1.0"
gem "jquery-ui-rails", "~> 5.0.2"
gem 'rails-timeago', '~> 2.0'
gem 'rails_autolink', '~> 1.1.0'
gem 'dynamic_form', '~> 1.1.4'
gem 'non-stupid-digest-assets'
# removed from Rails-core as Rails 4.0
gem 'actionpack-page_caching', '~> 1.0.2'
gem 'rails-observers', '~> 0.1.2'
group :assets do
gem 'sass-rails', " ~> 4.0.3"
gem 'coffee-rails', " ~> 4.0.1"
gem 'uglifier'
end
group :development, :test do
gem 'thin'
gem 'factory_girl', '~> 4.5.0'
gem 'capybara'
gem 'rspec-rails', '~> 3.1.0'
gem 'simplecov', :require => false
gem 'pry-rails'
gem 'better_errors', '~> 2.0.0'
gem 'binding_of_caller'
gem 'guard-rspec'
end
# Install gems from each theme
Dir.glob(File.join(File.dirname(__FILE__), 'themes', '**', "Gemfile")) do |gemfile|
eval(IO.read(gemfile), binding)
end
it looks like the part of the
Gemfile
that you want to use aka theif ENV["HEROKU"]
block is not being executed. instead, theelse
block is invoked which raises the error in the snippet of the log you posted.there are several possible causes of this that i'm going to write down in order of probablity
heroku config:set HEROKU=true
as explained in the publify documentation