NOTE: FriendlyId 4.x breaks compatibility with 3.x - ruby-on-rails

I create a new Refinery application and face some problems. I following to instuction on official web-site Refinery http://refinerycms.com/guides/heroku. One of this mistakes says: NOTE: FriendlyId 4.x breaks compatibility with 3.x. But I unload rails version 3.2.18. What problem is? When I open my application on heroku: We're sorry, but something went wrong.
My Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.18'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
group :production do
gem 'rails_log_stdout', github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
end
gem 'rails_12factor', group: :production
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
# Refinery CMS
gem 'refinerycms', '~> 2.1.0'
# Optionally, specify additional Refinery CMS Extensions here:
gem 'refinerycms-acts-as-indexed', '~> 1.0.0'
# gem 'refinerycms-blog', '~> 2.1.0'
# gem 'refinerycms-inquiries', '~> 2.1.0'
# gem 'refinerycms-search', '~> 2.1.0'
# gem 'refinerycms-page-images', '~> 2.1.0'
# The Heroku gem allows you to interface with Heroku's API
gem 'heroku'
# Fog allows you to use S3 assets (added for Heroku)
gem 'fog'
# Postgres support (added for Heroku)
gem 'pg'
Terminal:
ark#ark-Aspire-5750G:~/mirprirodi$ git push heroku master
Initializing repository, done.
Counting objects: 95, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (81/81), done.
Writing objects: 100% (95/95), 35.82 KiB, done.
Total 95 (delta 15), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.6.3
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Your Gemfile lists the gem pg (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Fetching gem metadata from https://rubygems.org/.......
Fetching additional metadata from https://rubygems.org/..
Fetching git://github.com/heroku/rails3_serve_static_assets.git
Fetching git://github.com/heroku/rails_log_stdout.git
Installing multi_json 1.10.1
Installing i18n 0.6.9
Installing rake 10.3.2
Installing builder 3.0.4
Installing journey 1.0.4
Installing erubis 2.7.0
Installing hike 1.2.3
Installing rack 1.4.5
Installing tilt 1.4.1
Installing polyglot 0.3.5
Installing mime-types 1.25.1
Installing arel 3.0.3
Installing acts_as_indexed 0.8.3
Installing addressable 2.3.6
Installing babosa 0.3.11
Installing tzinfo 0.3.39
Installing coffee-script-source 1.7.0
Installing execjs 2.2.1
Installing thor 0.19.1
Installing orm_adapter 0.5.0
Installing excon 0.37.0
Installing formatador 0.2.5
Installing json 1.8.1
Installing bcrypt 3.1.7
Installing inflecto 0.0.2
Installing ipaddress 0.8.0
Installing net-ssh 2.9.1
Installing mini_portile 0.6.0
Installing netrc 0.7.7
Using bundler 1.6.3
Using rails3_serve_static_assets 0.0.1 from git://github.com/heroku/rails3_serve_static_assets.git (at master)
Installing rubyzip 1.1.4
Installing rails_serve_static_assets 0.0.2
Using rails_log_stdout 0.0.1 from git://github.com/heroku/rails_log_stdout.git (at master)
Installing rails_stdout_logging 0.0.3
Installing truncate_html 0.9.2
Installing sass 3.3.9
Installing will_paginate 3.0.6
Installing fog-json 1.0.0
Installing activesupport 3.2.18
Installing rails-i18n 0.7.4
Installing rack-test 0.6.2
Installing rack-cache 1.2
Installing rack-ssl 1.3.4
Installing warden 1.2.3
Installing sprockets 2.2.2
Installing dragonfly 0.9.15
Installing treetop 1.4.15
Installing rest-client 1.6.7
Installing launchy 2.4.2
Installing coffee-script 2.2.0
Installing heroku-api 0.3.18
Installing rdoc 3.12.2
Installing uglifier 2.5.1
Installing bcrypt-ruby 3.1.5
Installing net-scp 1.2.1
Installing rails_12factor 0.0.2
Installing activemodel 3.2.18
Installing mail 2.5.4
Installing heroku 3.8.4
Installing fog-core 1.22.0
Installing actionpack 3.2.18
Installing activerecord 3.2.18
Installing activeresource 3.2.18
Installing fog-brightbox 0.1.0
Installing actionmailer 3.2.18
Installing railties 3.2.18
Installing routing-filter 0.3.1
Installing pg 0.17.1
Installing awesome_nested_set 2.1.6
Installing friendly_id 4.0.10.1
Installing globalize 3.1.0
Installing coffee-rails 3.2.2
Installing decorators 1.0.3
Installing devise 2.2.8
Installing jquery-rails 2.3.0
Installing rails 3.2.18
Installing sass-rails 3.2.6
Installing seo_meta 1.4.0
Installing refinerycms-i18n 2.1.0
Installing refinerycms-core 2.1.2
Installing refinerycms-dashboard 2.1.2
Installing refinerycms-authentication 2.1.2
Installing refinerycms-images 2.1.2
Installing refinerycms-pages 2.1.2
Installing refinerycms-resources 2.1.2
Installing refinerycms-acts-as-indexed 1.0.0
Installing refinerycms 2.1.2
Installing nokogiri 1.6.2.1
Installing fog 1.22.1
Your bundle is complete!
Gems in the groups development and test were not installed.
It was installed into ./vendor/bundle
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Post-install message from bcrypt-ruby:
#######################################################
The bcrypt-ruby gem has changed its name to just bcrypt. Instead of
installing `bcrypt-ruby`, you should install `bcrypt`. Please update your
dependencies accordingly.
#######################################################
Post-install message from heroku:
! The `heroku` gem has been deprecated and replaced with the Heroku Toolbelt.
! Download and install from: https://toolbelt.heroku.com
! For API access, see: https://github.com/heroku/heroku.rb
Post-install message from friendly_id:
NOTE: FriendlyId 4.x breaks compatibility with 3.x. If you're upgrading
from 3.x, please see this document:
http://rubydoc.info/github/norman/friendly_id/master/file/WhatsNew.md
Post-install message from globalize:
Globalize has extracted versioning support to a separate gem named
globalize-versioning. If you are using versioning (with paper_trail
or any other versioning gem), please add the line
"gem 'globalize-versioning'" to your Gemfile and go to the github
page at globalize/globalize-versioning if you encounter any problems.
Note that the globalize-versioning gem does not delegate versions to
the translation table, so you will have to update your syntax to
the form: `post.translation.versions`. See the globalize-versioning
readme for details.
Bundle completed (31.77s)
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Compiled jquery.js (4ms) (pid 1429)
Compiled jquery_ujs.js (0ms) (pid 1429)
Compiled application.js (15ms) (pid 1429)
Compiled application.css (0ms) (pid 1429)
Compiled jquery.js (5ms) (pid 1429)
Compiled jquery_ujs.js (0ms) (pid 1429)
Compiled application.js (69ms) (pid 1429)
Compiled application.css (0ms) (pid 1429)
Asset precompilation completed (18.38s)
-----> WARNINGS:
You have not declared a Ruby version in your Gemfile.
To set your Ruby version add this line to your Gemfile:
ruby '2.0.0'
# See https://devcenter.heroku.com/articles/ruby-versions for more information.
No Procfile detected, using the default web server (webrick)
https://devcenter.heroku.com/articles/ruby-default-web-server
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby -> console, rake, web, worker
-----> Compressing... done, 27.3MB
-----> Launching... done, v6
http://stormy-caverns-7064.herokuapp.com/ deployed to Heroku
To git#heroku.com:stormy-caverns-7064.git
* [new branch] master -> master
ark#ark-Aspire-5750G:~/mirprirodi$ heroku open
Opening stormy-caverns-7064... done
ark#ark-Aspire-5750G:~/mirprirodi$

Related

Heroku deploy failed on assets precompile

I have a "small issue".
Trying to learn Ruby On Rails, and now i want to deploy my project on heroku.
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.5.3
-----> Installing dependencies using bundler 1.15.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.6). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Fetching rake 12.3.2
Fetching concurrent-ruby 1.1.5
Fetching json 1.8.6
Installing rake 12.3.2
Installing json 1.8.6 with native extensions
Installing concurrent-ruby 1.1.5
Fetching minitest 5.11.3
Installing minitest 5.11.3
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching builder 3.2.3
Installing builder 3.2.3
Fetching erubis 2.7.0
Installing erubis 2.7.0
Fetching mini_portile2 2.4.0
Installing mini_portile2 2.4.0
Fetching crass 1.0.4
Installing crass 1.0.4
Fetching rack 1.6.11
Installing rack 1.6.11
Fetching mini_mime 1.0.1
Installing mini_mime 1.0.1
Fetching arel 6.0.4
Using bundler 1.15.2
Fetching coffee-script-source 1.12.2
Installing arel 6.0.4
Installing coffee-script-source 1.12.2
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching thor 0.20.3
Installing thor 0.20.3
Fetching ffi 1.10.0
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Installing ffi 1.10.0 with native extensions
Fetching pg 0.17.1
Installing pg 0.17.1 with native extensions
Fetching rails_serve_static_assets 0.0.5
Installing rails_serve_static_assets 0.0.5
Fetching rails_stdout_logging 0.0.5
Installing rails_stdout_logging 0.0.5
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rdoc 4.3.0
Installing rdoc 4.3.0
Fetching tilt 1.4.1
Installing tilt 1.4.1
Fetching i18n 0.9.5
Installing i18n 0.9.5
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching nokogiri 1.9.1
Installing nokogiri 1.9.1 with native extensions
Fetching rack-test 0.6.3
Installing rack-test 0.6.3
Fetching sprockets 3.7.2
Installing sprockets 3.7.2
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Fetching rails_12factor 0.0.2
Installing rails_12factor 0.0.2
Fetching rb-inotify 0.9.10
Installing rb-inotify 0.9.10
Fetching activesupport 4.2.0
Installing activesupport 4.2.0
Fetching sdoc 0.4.0
Installing sdoc 0.4.0
Fetching uglifier 2.5.3
Installing uglifier 2.5.3
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching rails-deprecated_sanitizer 1.0.3
Fetching globalid 0.4.2
Installing globalid 0.4.2
Installing rails-deprecated_sanitizer 1.0.3
Fetching activemodel 4.2.0
Fetching jbuilder 2.2.3
Installing activemodel 4.2.0
Installing jbuilder 2.2.3
Fetching sass 3.7.3
Fetching activejob 4.2.0
Installing activejob 4.2.0
Installing sass 3.7.3
Fetching activerecord 4.2.0
Installing activerecord 4.2.0
Fetching rails-dom-testing 1.0.9
Fetching loofah 2.2.3
Installing rails-dom-testing 1.0.9
Installing loofah 2.2.3
Fetching rails-html-sanitizer 1.0.4
Installing rails-html-sanitizer 1.0.4
Fetching actionview 4.2.0
Installing actionview 4.2.0
Fetching actionpack 4.2.0
Installing actionpack 4.2.0
Fetching railties 4.2.0
Fetching actionmailer 4.2.0
Fetching sprockets-rails 3.2.1
Installing sprockets-rails 3.2.1
Installing railties 4.2.0
Installing actionmailer 4.2.0
Fetching jquery-rails 4.0.3
Fetching rails 4.2.0
Fetching coffee-rails 4.1.0
Installing coffee-rails 4.1.0
Installing jquery-rails 4.0.3
Installing rails 4.2.0
Fetching sass-rails 5.0.3
Installing sass-rails 5.0.3
Fetching turbolinks 2.3.0
Installing turbolinks 2.3.0
Bundle complete! 17 Gemfile dependencies, 57 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into ./vendor/bundle.
Post-install message from sass:
Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.
* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
* For more details, please refer to the Sass blog:
http://sass.logdown.com/posts/7081811
Bundle completed (39.08s)
Cleaning up the bundler cache.
-----> Installing node-v10.14.1-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
/tmp/build_af4ee1266f205da440cd39f395d56ff3/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.0/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
/tmp/build_af4ee1266f205da440cd39f395d56ff3/vendor/bundle/ruby/2.5.0/gems/activesupport-4.2.0/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
rake aborted!
SystemStackError: stack level too deep
After this i have so much errors, and after them:
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed
I tried to:
1.Add "config.assets.initialize_on_precompile = false" to my application.rb file.
2.Initialize RAILS_ENV=production bundle exec rake assets:precompile
3.Delete application.css (actually, this css file is blank)
But i still can't deploy.
Maybe this can help you:
Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
Database.yml file (maybe problem is here, idk):
# PostgreSQL. Versions 8.2 and up are supported.
#
# Install the pg driver:
# gem install pg
# On Mac OS X with macports:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem 'pg'
#
development:
adapter: postgresql
encoding: unicode
database: sample_postgres_development
pool: 5
username: sample_postgres
password:
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
#host: localhost
#port: 5432
# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
# The server defaults to notice.
#min_messages: warning
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
database: sample_postgres_test
pool: 5
username: sample_postgres
password:
production:
adapter: postgresql
encoding: unicode
database: sample_postgres_production
pool: 5
username: sample_postgres
password:
Application.js file(actually blank):
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .

Heroku destroys pg gem during deployment

I am attempting to deploy a Heroku application based on Ruby on Rails, and am having some issues. Although none of these issues existed in past deployments, Heroku randomly deletes the pg gem after deployment. This is my gemfile:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.3'
# User rails12 factor for heroku's native ruby support tweaks
gem 'rails_12factor'
# Use wdm for Windows poll changes
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Bootstrap 3 for themeing and templating
gem 'bootstrap-sass'
# Use bootstrapformfor to allow forms to be auto-formatted as per bootstrap standards
gem 'bootstrap_form'
# Use JQuery code optimized for Bootstrap usage
gem 'jquery-rails'
# Use Dragonfly for image upload and handling
gem 'dragonfly', '~> 1.1.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease
gem 'jbuilder', '~> 2.5'
# Use Devise for account management and authorization
gem 'devise'
# Use Cancancan for permissions enforcement
gem 'cancancan'
# Use rolify for role assignment to user accounts
gem 'rolify'
# Windows does not include zoneinfo files so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
# Postgres for active record
gem 'pg'
end
Here is the deployment log:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.3.4
###### WARNING:
Removing `Gemfile.lock` because it was generated on Windows.
Bundler will do a full resolve so native gems are handled properly.
This may result in unexpected gem versions being used in your app.
In rare occasions Bundler may not be able to resolve your dependencies at all.
https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 1.15.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.0
Using concurrent-ruby 1.0.5
Fetching minitest 5.11.1
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubi 1.7.0
Using mini_portile2 2.3.0
Using crass 1.0.3
Using rack 2.0.3
Fetching nio4r 2.2.0
Using websocket-extensions 0.1.3
Using mini_mime 1.0.0
Using arel 8.0.0
Fetching public_suffix 3.0.1
Installing public_suffix 3.0.1
Installing minitest 5.11.1
Installing nio4r 2.2.0 with native extensions
Using execjs 2.7.0
Using bcrypt 3.1.11
Using rb-fsevent 0.10.2
Using ffi 1.9.18
Using bootstrap_form 2.7.0
Using bundler 1.15.2
Using cancancan 2.1.2
Using coffee-script-source 1.12.2
Using method_source 0.9.0
Using thor 0.20.0
Using orm_adapter 0.5.0
Fetching multi_json 1.13.1
Using puma 3.11.0
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Fetching rolify 5.2.0
Installing multi_json 1.13.1
Installing rolify 5.2.0
Using tilt 2.0.8
Fetching turbolinks-source 5.1.0
Using i18n 0.9.1
Using nokogiri 1.8.1
Installing turbolinks-source 5.1.0
Using tzinfo 1.2.4
Using rack-test 0.8.2
Using warden 1.2.7
Using sprockets 3.7.1
Using websocket-driver 0.6.5
Using mail 2.7.0
Fetching autoprefixer-rails 7.2.4
Fetching uglifier 4.1.3
Installing autoprefixer-rails 7.2.4
Installing uglifier 4.1.3
Using rb-inotify 0.9.10
Using coffee-script 2.4.1
Fetching addressable 2.5.2
Using rails_12factor 0.0.3
Using loofah 2.1.1
Using activesupport 5.1.4
Fetching turbolinks 5.1.0
Installing turbolinks 5.1.0
Installing addressable 2.5.2
Using sass-listen 4.0.0
Using rails-html-sanitizer 1.0.3
Using rails-dom-testing 2.0.3
Using globalid 0.4.1
Using activemodel 5.1.4
Using jbuilder 2.7.0
Fetching dragonfly 1.1.4
Fetching sass 3.5.5
Installing dragonfly 1.1.4
Installing sass 3.5.5
Using activejob 5.1.4
Using actionview 5.1.4
Using activerecord 5.1.4
Using actionpack 5.1.4
Using actionmailer 5.1.4
Using railties 5.1.4
Using sprockets-rails 3.2.1
Using coffee-rails 4.2.2
Using responders 2.4.0
Using jquery-rails 4.3.1
Fetching devise 4.4.0
Installing devise 4.4.0
Using bootstrap-sass 3.3.7
Using sass-rails 5.0.7
Using actioncable 5.1.4
Using rails 5.1.4
Bundle complete! 25 Gemfile dependencies, 72 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into ./vendor/bundle.
Bundle completed (8.28s)
Cleaning up the bundler cache.
Removing rolify (5.1.0)
Removing turbolinks (5.0.1)
Removing autoprefixer-rails (7.1.6)
Removing sass (3.5.3)
Removing mime-types-data (3.2016.0521)
Removing nio4r (2.1.0)
Removing minitest (5.10.3)
Removing devise (4.3.0)
Removing mimemagic (0.3.2)
Removing cocaine (0.5.8)
Removing pg (0.21.0)
Removing uglifier (3.2.0)
Removing multi_json (1.12.2)
Removing paperclip (5.0.0)
Removing turbolinks-source (5.0.3)
Removing mime-types (3.1)
Removing climate_control (0.2.0)
The latest bundler is 1.16.1, but you are currently running 1.15.2.
To update, run `gem install bundler`
-----> Installing node-v6.11.1-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
ETCETCETC
Note how it randomly deletes the 'pg' gem after initial bundling. Could someone point me in the right direction?
Set your pg gem to require version 0.2x in your Gemfile:
gem 'pg', '~> 0.20'
What's happening is you're system is incorrectly attempting to use a newer, incompatible version of pg. pg 1.0.0 was released January 10, 2018, but it's not currently supported by rails. Since you aren't specifying which version of pg to use, you're system is trying to use the new version of pg, removing the old version, then failing.
See this rails issue, and this rails issue and this fix (Revert to pg 0.21.0 as Rails does not support pg 1.0.0 yet) for more discussion.
Put your pg gem out of development environment.
Remove gem pg from developement
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
and keep it outside from developement
# Postgres for active record
gem 'pg'
Try to the following
Remove gem 'pg' from group :development and keep that on Gemfile outside of group, then run bundler bundle update then follow these steps
git add .
git commit -m "Fixed gem pg issue"
git push heroku master
That will work
If you little bit confused again see the Heroku documentation and start from scratch
Thanks

(Cloud9) The application works fine on the local server but not on heroku

The application works fine on the local server but once it is deployed on heroku , it loses its formatting and also loses its functions. I am including pictures of the local server and heroku.
I am so fraustrated, dont know what to do, even after db:migrate I run the heroku restart. Still no luck!!!
This is my Heroku Log:
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.3.4
-----> Installing dependencies using bundler 1.15.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.0). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Using rake 12.2.1
Using concurrent-ruby 1.0.5
Using json 1.8.6
Using minitest 5.10.3
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using crass 1.0.2
Using rack 1.6.8
Using mini_mime 0.1.4
Using arel 6.0.4
Using execjs 2.7.0
Using rb-fsevent 0.10.2
Using ffi 1.9.18
Using bundler 1.15.2
Using coffee-script-source 1.12.2
Using thor 0.20.0
Using multi_json 1.12.2
Using pg 0.21.0
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using rdoc 4.3.0
Using tilt 2.0.8
Using turbolinks-source 5.0.3
Using i18n 0.9.1
Using tzinfo 1.2.4
Using nokogiri 1.8.1
Using rack-test 0.6.3
Using sprockets 3.7.1
Using mail 2.7.0
Using autoprefixer-rails 7.1.6
Using uglifier 3.2.0
Using coffee-script 2.4.1
Using rb-inotify 0.9.10
Using rails_12factor 0.0.3
Using activesupport 4.2.5
Using sdoc 0.4.2
Using loofah 2.1.1
Using turbolinks 5.0.1
Using sass-listen 4.0.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.4.1
Using activemodel 4.2.5
Using jbuilder 2.7.0
Using rails-html-sanitizer 1.0.3
Using sass 3.5.3
Using rails-dom-testing 1.0.8
Using activerecord 4.2.5
Using activejob 4.2.5
Using actionview 4.2.5
Using bootstrap-sass 3.3.7
Using actionpack 4.2.5
Using actionmailer 4.2.5
Using railties 4.2.5
Using sprockets-rails 3.2.1
Using coffee-rails 4.1.1
Using jquery-rails 4.3.1
Using rails 4.2.5
Using sass-rails 5.0.6
Bundle complete! 15 Gemfile dependencies, 60 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into ./vendor/bundle.
The latest bundler is 1.16.0, but you are currently running 1.15.2.
To update, run `gem install bundler`
Bundle completed (2.66s)
Cleaning up the bundler cache.
Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.0). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
The latest bundler is 1.16.0, but you are currently running 1.15.2.
To update, run `gem install bundler`
-----> Installing node-v6.11.1-linux-x64
Detected manifest file, assuming assets were compiled locally
###### WARNING:
No Procfile detected, using the default web server.
We recommend explicitly declaring how to boot your server process via a Procfile.
https://devcenter.heroku.com/articles/ruby-default-web-server
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> console, rake, web, worker
-----> Compressing...
Done: 40.9M
-----> Launching...
Released v19
https://xiaolong-blog.herokuapp.com/ deployed to Heroku
This is my Gemfile,.
Gemfile:
source 'https://rubygems.org'
ruby '2.3.4'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use sqlite3 as the database for Active Record
# Use SCSS for stylesheets
gem 'bootstrap-sass', '~> 3.3.7'
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
Add this near
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"> </script>
</head>
Runon terminal:
RAILS_ENV=production bundle exec rake assets:precompile

rails server and console not loading

Using rbenv and Rails 4.2.6, when I run bundle exec rails s or bundle exec rails c, I see the following:
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
That's all, nothing else happens. If I then stop spring, and run bundle exec rails c, the following appears:
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
dyld: lazy symbol binding failed: Symbol not found: _rb_data_typed_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
Expected in: flat namespace
dyld: Symbol not found: _rb_data_typed_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
Expected in: flat namespace
Any idea what's wrong here? Thanks!
Update: add content of gemfile and ouput of bundle install
Gemfile:
source 'https://rubygems.org'
ruby "2.3.1"
gem 'rails', '4.2.6'
gem 'pg'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'simple_form'
gem "puma"
gem 'dotenv-rails', :groups => [:development, :test]
gem 'quiet_assets', :group => :development
gem "rails_12factor"
gem 'slack-ruby-client'
gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x'
gem 'bootstrap-sass', '~> 3.3.6'
group :development, :test do
gem 'byebug'
gem 'rspec-rails', '~> 3.4'
gem 'factory_girl_rails', '~> 4.0'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'guard'
gem 'guard-rspec', require: false
gem 'terminal-notifier-guard'
gem 'spring'
end
Output of bundle install:
Using rake 11.2.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using execjs 2.7.0
Using debug_inspector 0.0.2
Using sass 3.4.22
Using byebug 9.0.5
Using coderay 1.1.1
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using diff-lcs 1.2.5
Using dotenv 2.1.1
Using multipart-post 2.0.0
Using ffi 1.9.10
Using formatador 0.2.5
Using gli 2.14.0
Using rb-fsevent 0.9.7
Using ruby_dep 1.3.1
Using lumberjack 1.0.10
Using nenv 0.3.0
Using shellany 0.0.1
Using method_source 0.8.2
Using slop 3.6.0
Using guard-compat 1.2.1
Using rspec-support 3.4.1
Using hashie 3.4.4
Using multi_json 1.12.1
Using pg 0.18.4
Using puma 3.4.0
Using bundler 1.12.5
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using tilt 2.0.5
Using websocket-extensions 0.1.2
Using spring 1.7.1
Using terminal-notifier-guard 1.7.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8
Using rack-test 0.6.3
Using mime-types 3.1
Using autoprefixer-rails 6.3.6.2
Using uglifier 3.0.0
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using sprockets 3.6.1
Using faraday 0.9.2
Using rb-inotify 0.9.7
Using notiffany 0.1.0
Using pry 0.10.3
Using rspec-core 3.4.4
Using rspec-expectations 3.4.0
Using rspec-mocks 3.4.1
Using rails_12factor 0.0.3
Using websocket-driver 0.6.4
Using sdoc 0.4.1
Using activesupport 4.2.6
Using loofah 2.0.3
Using mail 2.6.4
Using bootstrap-sass 3.3.6
Using faraday_middleware 0.10.0
Using listen 3.1.5
Using rspec 3.4.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.6
Using factory_girl 4.7.0
Using jbuilder 2.5.0
Using rails-html-sanitizer 1.0.3
Using slack-ruby-client 0.7.4
Using guard 2.14.0
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using guard-rspec 4.7.2
Using actionview 4.2.6
Using actionpack 4.2.6
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.0.4
Using simple_form 3.2.1
Using coffee-rails 4.1.1
Using dotenv-rails 2.1.1
Using factory_girl_rails 4.7.0
Using jquery-rails 4.1.1
Using quiet_assets 1.1.0
Using rails-i18n 4.0.8 from git://github.com/svenfuchs/rails-i18n.git (at rails-4-x#129b9fb)
Using rspec-rails 3.4.2
Using rails 4.2.6
Using sass-rails 5.0.4
Using web-console 2.3.0
Using turbolinks 2.5.3
Bundle complete! 25 Gemfile dependencies, 102 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Update 2 - added bundle exec gem pristine --all
bundle exec gem pristine --all
Restoring gems to pristine condition...
Restored rake-11.2.2
Restored i18n-0.7.0
Skipped json-1.8.3, it is a default gem
Restored minitest-5.9.0
Restored thread_safe-0.3.5
Restored tzinfo-1.2.2
Restored activesupport-4.2.6
Restored builder-3.2.2
Restored erubis-2.7.0
Restored mini_portile2-2.1.0
Restored pkg-config-1.1.7
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Ext::BuildError)
ERROR: Failed to build gem native extension.
current directory: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/nokogiri-1.6.8/ext/nokogiri
/Users/nandersen/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20160620-6035-1m3373p.rb extconf.rb
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
/Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:95:in `block in materialize': Could not find nokogiri-1.6.8 in any of the sources (Bundler::GemNotFound)
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `map!'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `materialize'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:140:in `specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:185:in `specs_for'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/definition.rb:174:in `requested_specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/environment.rb:19:in `requested_specs'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:14:in `setup'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:95:in `setup'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/setup.rb:19:in `<top (required)>'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/nandersen/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
extconf failed, exit code 1
Gem files will remain installed in /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/nokogiri-1.6.8 for inspection.
Results logged to /Users/nandersen/Projects/the-lunch/vendor/bundle/extensions/x86_64-darwin-15/2.3.0-static/nokogiri-1.6.8/gem_make.out
The problem is debug_inspector gem, you could try to remove web-console gem in your Gemfile, bundle install, and run the server again.
UPDATE:
Or if you would like to keep the web-console gem, you could try to remove all the gems you have installed, and re-bundle install them again. According to this issue on rails/web-console.

Travis CI can't find 'pg' gem

I'm using Travis CI to test my Rails project.
When it build my commit, it stops on bundle exec rake.
Part of log:
$ gem --version
2.2.2
$ bundle --version
Bundler version 1.6.2
$ bundle install --jobs=3 --retry=3 --deployment
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Installing i18n 0.6.11
Installing rake 10.3.2
Installing minitest 5.4.0
Installing thread_safe 0.3.4
Installing builder 3.2.2
Installing json 1.8.1
Installing erubis 2.7.0
Installing mime-types 1.25.1
Installing rack 1.5.2
Installing polyglot 0.3.5
Installing arel 5.0.1.20140414130214
Installing execjs 2.2.1
Installing coffee-script-source 1.7.1
Installing thor 0.19.1
Installing hike 1.2.3
Using bundler 1.6.2
Installing multi_json 1.10.1
Installing tilt 1.4.1
Installing rails_serve_static_assets 0.0.2
Installing rails_stdout_logging 0.0.3
Installing tzinfo 1.2.1
Installing sass 3.2.19
Installing rack-test 0.6.2
Installing rdoc 4.1.1
Installing treetop 1.4.15
Installing coffee-script 2.3.0
Installing uglifier 2.5.3
Installing sprockets 2.11.0
Installing rails_12factor 0.0.2
Installing sdoc 0.4.0
Installing activesupport 4.1.4
Installing mail 2.5.4
Installing actionview 4.1.4
Installing jbuilder 2.1.3
Installing activemodel 4.1.4
Installing actionpack 4.1.4
Installing activerecord 4.1.4
Installing railties 4.1.4
Installing sprockets-rails 2.1.3
Installing actionmailer 4.1.4
Installing coffee-rails 4.0.1
Installing jquery-rails 3.1.1
Installing sass-rails 4.0.3
Installing turbolinks 2.2.2
Installing rails 4.1.4
Your bundle is complete!
It was installed into ./vendor/bundle
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
$ psql -c 'create database travis_ci_test;' -U postgres
CREATE DATABASE
$ cp config/database.yml.travis config/database.yml
$ bundle exec rake
rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
(As you can see, there is no pg gem installed).
My .travis.yml:
language: ruby
rvm:
- "2.0.0"
addons:
postgresql: "9.3"
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
- cp config/database.yml.travis config/database.yml
My Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.4'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
gem 'rails_12factor', group: :production
ruby "2.0.0"
So 'pg' gem is in the Gemfile and it works on my computer, but Travis doesn't install it.
Is the 'pg' gem in your Gemfile.lock file? If not, you may need to delete this file and regenerate it by running bundle install again.
Removing Gemfile.lock from the repository worked, now build and testing is working as expected.
I guess that happens because of lock-file being created on Windows, and it includes some platform-specific stuff (like mingw32 suffixes for gems)

Resources