-1

Good day,

I made an app with masonry and js.coffee to make something like "pins" in my app, but when I deploy to Heroku don't work like suppose to do.

This is my gem file

source 'https://rubygems.org'

ruby '2.1.4'

gem 'binding_of_caller'
gem 'masonry-rails', '~> 0.2.0'
gem 'haml' 
gem 'high_voltage', '~> 2.3.0'
gem 'activevalidators'
gem 'paperclip', github: 'thoughtbot/paperclip'
gem 'simple_form', '~>3.0.2'
gem 'acts_as_votable'
gem 'bootstrap-sass'
gem 'devise', '~> 3.4.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use sqlite3 as the database for Active Record
# Use SCSS for stylesheets
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 :assets do
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-rails'
gem 'libv8'

end

group :production do
    gem 'pg'
    gem 'rails_12factor'
end

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
  gem 'sqlite3'
  # 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

My application.js

// 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/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require bootstrap-sprockets
//= require masonry/jquery.masonry
//= require turbolinks
//= require_tree .

My js.coffee to show pins

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

$ ->
  $('#pins').imagesLoaded ->
    $('#pins').masonry
      itemSelector: '.box'
      isFitWidth: true

My index for pins

- content_for :board do
  = javascript_include_tag 'application', 'data-turbolinks-track' => true
  #pins.transitions-enabled
    - @pins.each do |pin|
      .box.panel.panel-default
        = link_to (image_tag pin.image.url), pin
        %h2
          = link_to pin.title, pin
        %p.user
          Ofertado por
          = pin.user.name
        %p.price
          $
          = pin.price

Am I doing something wrong?

IDGM5
  • 159
  • 1
  • 1
  • 9
  • what is the exact error??? did it work well in your local? – MAC May 11 '15 at 04:38
  • Masonry don't work in my app, that function resize my images in pins and sort in chronological way at the same time my index became responsive. Like this http://www.parisvega.com/wp-content/uploads/2013/02/pinterest-masonry-grid-layout-pure-css-less-500x301.png --- But is not working – IDGM5 May 11 '15 at 05:19

1 Answers1

0

If it works well under development and won't work upon deployment in heroku, you might have mistakenly configured your database.yml under config.

production:
adapter: postgresql
encoding: utf8
database: (copy database name from your heroku database info)
username: (copy username from your heroku database info)
password: TV9ncj-HR1FqNFihKm6zlsHhxU
host: (copy host from your heroku database info)
sslmode: require

and don't forget to do the rake db:migrate

if this is not the answer you were looking for, this might still be a little useful for you, if not now, maybe in the near future as you go along with your code.

MAC
  • 656
  • 3
  • 13
  • 31