Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails deployment on Heroku - bootstrap-sass

I have quite problem with deploying on heroku. Really don't no why it doesn't work.

Here is my gem file:

gem 'rails', '3.2.0'
gem 'pg'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
end
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'jquery-rails'
gem "rspec-rails", ">= 2.8.1", :group => [:development, :test]
gem "factory_girl_rails", ">= 1.7.0", :group => :test
gem "email_spec", ">= 1.2.1", :group => :test
gem "cucumber-rails", ">= 1.3.0", :group => :test
gem "capybara", ">= 1.1.2", :group => :test
gem "database_cleaner", ">= 0.7.1", :group => :test
gem "launchy", ">= 2.0.5", :group => :test
gem "devise", ">= 2.0.4"
gem 'haml-rails', '>= 0.3.4', :group => :development
gem 'bootstrap-sass', '~> 2.0.2'

Heroku log:

 cache: [GET /] miss 
 /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'         
 vendor/bundle/ruby/1.9.1/gems/railties-3.2.0/lib/rails/rack/log_tailer.rb:14:in `call'
/usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

Simple app layout

%html
  %head
  %title iPinTeam
  %meta{:charset => "utf-8"}
  %meta{"http-equiv" => "X-UA-Compatible", :content => "IE=edge,chrome=1"}
  %meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"}
  %meta{:content => "", :name => "description"}
  %meta{:content => "", :name => "author"}
  = stylesheet_link_tag :application, :media => "all"
  = javascript_include_tag :application
  = csrf_meta_tags
%body{:class => params[:controller]}
 .navbar.navbar-fixed-top
  .navbar-inner
    .container
    = render 'shared/navigation'
#container.container
  #main{:role => "main"}
    - flash.each do |name, msg|
      = content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) 
    = yield
%footer

Sorry if is the question totally stupid, I'm little bit confused about why it is given this error:( In logs are also many errors in:

vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.0
vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.0
etc...

On the heroku is still poor - We're sorry, but something went wrong.

Think that the problem is maybe with gem bootstrap-sass on heroku. I already tried switch to thin web server but it was total mess:( Can someone help me with this and maybe little bit describe the error. If some additional information will be needed, gonna post them immediately.Thank you...

like image 797
Tom Hert Avatar asked Nov 28 '22 02:11

Tom Hert


2 Answers

You will need to precompile your assets before uplading to heroku.

Try rake assets:precompile and then upload to Heroku.

like image 102
MrJacket Avatar answered Nov 30 '22 16:11

MrJacket


I could not view the site with bootstrap CSS on Heroku so I did the following change on config/environments/production.rb, change the line:

config.assets.compile = false

To:

config.assets.compile = true
like image 32
Caner Avatar answered Nov 30 '22 18:11

Caner