Deploying my local app with database to Heroku - ruby-on-rails

I am new to Rails, very new to Heroku.
I have just uploaded my application to Heroku.
But when I opened the site, I only see this error message; "We're sorry, but something went wrong."
So I the heroku logs command and here is the log.
It has something to do with the css file but I couldnt understand it...
2013-06-25T19:19:17.196893+00:00 app[web.1]: [2013-06-25 19:19:17] INFO ruby 2.0.0 (2013-05-14) [x86_64-linux]
2013-06-25T19:19:17.196893+00:00 app[web.1]: [2013-06-25 19:19:17] INFO WEBrick 1.3.1
2013-06-25T19:19:17.197592+00:00 app[web.1]: [2013-06-25 19:19:17] INFO WEBrick::HTTPServer#start: pid=2 port=45226
2013-06-25T19:19:17.771088+00:00 heroku[web.1]: State changed from starting to up
2013-06-25T19:20:03.828188+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:45226
2013-06-25T19:20:03.828188+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-06-25T19:20:03.828188+00:00 app[web.1]: => Booting WEBrick
2013-06-25T19:20:03.828188+00:00 app[web.1]: => Call with -d to detach
2013-06-25T19:20:03.828188+00:00 app[web.1]: Started GET "/" for 68.45.84.42 at 2013-06-25 19:20:03 +0000
2013-06-25T19:20:08.600921+00:00 app[web.1]:
2013-06-25T19:20:08.600921+00:00 app[web.1]: ActionView::Template::Error (Invalid CSS after "...abel { font-s ": expected "{", was "}"
2013-06-25T19:20:08.600921+00:00 app[web.1]: 9: <meta name="description" content="fatihnetwork.com | fatih universitesi ogrencileri bulusma platformu" />
2013-06-25T19:20:08.600921+00:00 app[web.1]: 15: </head>
2013-06-25T19:20:08.600921+00:00 app[web.1]: (in /app/app/assets/stylesheets/application.css)):
2013-06-25T19:20:08.601453+00:00 app[web.1]: Compiled omniauth_callbacks.css (2ms) (pid 2)
2013-06-25T19:20:08.600921+00:00 app[web.1]: 10: <meta name="keywords" content="fatih universitesi, fatih, fatih ¸niversitesi ¸niversite, foursquare t¸rkiye, foursquare, four square, facebook, facebook t¸rkiye" />
2013-06-25T19:20:08.600921+00:00 app[web.1]: 13: <%= javascript_include_tag "application" %>
2013-06-25T19:20:08.601131+00:00 app[web.1]:
2013-06-25T19:20:08.601453+00:00 app[web.1]: Processing by HomeController#index as HTML
2013-06-25T19:20:08.601453+00:00 app[web.1]: Rendered home/index.html.erb within layouts/application (4.9ms)
2013-06-25T19:20:08.601453+00:00 app[web.1]: Compiled home.css (119ms) (pid 2)
2013-06-25T19:20:08.600921+00:00 app[web.1]: 12: <%= stylesheet_link_tag "application", :media => "all" %>
2013-06-25T19:20:08.601131+00:00 app[web.1]: app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb__4210444077502940588_70087393743220'
2013-06-25T19:20:08.601453+00:00 app[web.1]: Compiled application.css (4111ms) (pid 2)
2013-06-25T19:20:08.600921+00:00 app[web.1]: 11: <meta name="Copyright" content="" />
2013-06-25T19:20:08.600921+00:00 app[web.1]: 14: <%= csrf_meta_tags %>
2013-06-25T19:20:08.601131+00:00 app[web.1]:
2013-06-25T19:20:08.601453+00:00 app[web.1]: Completed 500 Internal Server Error in 4241ms
2013-06-25T19:20:08.601453+00:00 app[web.1]: Compiled active_admin.css (3753ms) (pid 2)

You're right, it seems to be a CSS syntax error.
ActionView::Template::Error (Invalid CSS after "...abel { font-s ": expected "{", was "}"
Means that the CSS compiler was expecting an opening bracket "{" but instead got a closing bracket "}" and doesn't know what that means. Try doing a ctrl+f or command+f to find "...abel { font-s " in your code and see if there is a syntax error there.
Hope this helps! :)

Related

Rails project on Heroku: "We're sorry, but something went wrong"

I have just pushed a rails project to heroku, but I get the "We're sorry, but something went wrong."-error when I try to visit the web address. I did heroku run rake db:migrate just after I uploaded the project. Does someone know what the issue might be?
2013-07-07T03:18:40.493412+00:00 heroku[web.1]: State changed from starting to up
2013-07-07T03:19:30.121757+00:00 app[web.1]: => Booting WEBrick
2013-07-07T03:19:30.121757+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:7276
2013-07-07T03:19:30.121757+00:00 app[web.1]: => Call with -d to detach
2013-07-07T03:19:30.121757+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-07-07T03:19:30.121757+00:00 app[web.1]: Started GET "/" for 216.15.124.94 at 2013-07-07 03:19:30 +0000
2013-07-07T03:19:30.298842+00:00 app[web.1]: Processing by PagesController#lelist as HTML
2013-07-07T03:19:30.683128+00:00 app[web.1]: Completed 500 Internal Server Error in 384ms
2013-07-07T03:19:30.680391+00:00 app[web.1]: Rendered pages/_singlePost.html.erb (39.1ms)
2013-07-07T03:19:30.687518+00:00 app[web.1]: 1: <% #posts.each do |p| %>
2013-07-07T03:19:30.682956+00:00 app[web.1]: Rendered pages/lelist.html.erb within layouts/application (122.9ms)
2013-07-07T03:19:30.687518+00:00 app[web.1]: 3: <div class="span6 offset3">
2013-07-07T03:19:30.687741+00:00 app[web.1]: app/views/pages/_singlePost.html.erb:1:in `_app_views_pages__single_ost_html_erb___4229188597617574554_47615640'
2013-07-07T03:19:30.687741+00:00 app[web.1]:
2013-07-07T03:19:30.687518+00:00 app[web.1]: 4: <div class="thumbnail">
2013-07-07T03:19:30.687741+00:00 app[web.1]: app/views/pages/lelist.html.erb:22:in `_app_views_pages_lelist_html_erb___4165065758361537325_47142940'
2013-07-07T03:19:30.687518+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "posts" WHERE (DATETIME(created_at) ...
2013-07-07T03:19:30.687518+00:00 app[web.1]: : SELECT "posts".* FROM "posts" WHERE (DATETIME(created_at) <= DATETIME('2013-07-07 03:19:30.364173')) ORDER BY created_at DESC LIMIT 10 OFFSET 0):
2013-07-07T03:19:30.687518+00:00 app[web.1]: HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2013-07-07T03:19:30.687741+00:00 app[web.1]:
2013-07-07T03:19:30.687518+00:00 app[web.1]:
2013-07-07T03:19:30.687518+00:00 app[web.1]: ActionView::Template::Error (PGError: ERROR: function datetime(timestamp without time zone) does not exist
2013-07-07T03:19:30.687518+00:00 app[web.1]: 2: <div class="row">
A little further down in the log I get another error:
2013-07-07T03:35:54.804738+00:00 app[web.1]: ActionView::Template::Error (PGError: ERROR: function datetime(timestamp without time zone) does not exist
2013-07-07T03:35:54.804738+00:00 app[web.1]: LINE 1: SELECT "posts".* FROM "posts" WHERE (DATETIME(created_at) ...
2013-07-07T03:35:54.804738+00:00 app[web.1]: ^
2013-07-07T03:35:54.804738+00:00 app[web.1]: HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2013-07-07T03:35:54.804738+00:00 app[web.1]: : SELECT "posts".* FROM "posts" WHERE (DATETIME(created_at) <= DATETIME('2013-07-07 03:35:54.572183')) ORDER BY created_at DESC LIMIT 10 OFFSET 0):
2013-07-07T03:35:54.804738+00:00 app[web.1]: 1: <% #posts.each do |p| %>
2013-07-07T03:35:54.804738+00:00 app[web.1]: 4: <div class="thumbnail">
2013-07-07T03:35:54.804738+00:00 app[web.1]: 2: <div class="row">
2013-07-07T03:35:54.804738+00:00 app[web.1]: 3: <div class="span6 offset3">
2013-07-07T03:35:54.804934+00:00 app[web.1]: app/views/pages/_singlePost.html.erb:1:in `_app_views_pages__single_ost_html_erb___4229188597617574554_47615640'
2013-07-07T03:35:54.804934+00:00 app[web.1]: app/views/pages/lelist.html.erb:22:in `_app_views_pages_lelist_html_erb___4165065758361537325_47142940'
Heroku uses postgresql for your database. DATETIME is not a function postgres supports. You should set up a postgresql database of the same version in your development environment. What OS are you on? If windows, I wrote any answer for that (some of it is applicable even if you're running linux).

Debugging Heroku Deployment (500 Error)

I've been working on deploying my first rails app to heroku for the past few nights and am struggling to figure out how to solve this problem.
I used Michael Hartl's tutorial (http://ruby.railstutorial.org/chapters/beginning#sec-deploying) to make sure I set up my app on the Cedar Stack.
Per the Heroku tutorial, I'm using "thin" as the server.
I've read a bunch of posts and have precompiled my assets using:
heroku run bundle exec rake assets:precompile
bundle exec rake assets:precompile
I have also migrated my databases.
My app works on my localhost.
Here is my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.8'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby'
gem 'thin'
group :development, :test do
gem 'rspec-rails'
end
group :development do
gem 'sqlite3'
end
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :production do
gem 'pg'
end
# 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'
group :test do
gem 'capybara'
gem 'factory_girl_rails'
end
Here are my heroku logs
2012-09-02T01:56:17+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2012-09-02T01:56:20+00:00 app[web.1]: => Booting Thin
2012-09-02T01:56:20+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:50510
2012-09-02T01:56:20+00:00 app[web.1]: => Call with -d to detach
2012-09-02T01:56:20+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-09-02T01:56:20+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2012-09-02T01:56:21+00:00 app[web.1]: >> Thin web server (v1.4.1 codename Chromeo)
2012-09-02T01:56:21+00:00 app[web.1]: >> Maximum connections set to 1024
2012-09-02T01:56:21+00:00 app[web.1]: >> Listening on 0.0.0.0:50510, CTRL+C to stop
2012-09-02T01:56:21+00:00 heroku[web.1]: State changed from starting to up
2012-09-02T01:56:23+00:00 app[web.1]:
2012-09-02T01:56:23+00:00 app[web.1]:
2012-09-02T01:56:23+00:00 app[web.1]: Started GET "/" for 108.210.1.241 at 2012-09-02 01:56:23 +0000
2012-09-02T01:56:23+00:00 app[web.1]: Processing by StaticPagesController#home as HTML
2012-09-02T01:56:23+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (14.9ms)
2012-09-02T01:56:23+00:00 app[web.1]: Completed 500 Internal Server Error in 103ms
2012-09-02T01:56:23+00:00 app[web.1]: ActionView::Template::Error (screen.css isn't precompiled):
2012-09-02T01:56:23+00:00 app[web.1]:
2012-09-02T01:56:23+00:00 app[web.1]: 2: <html>
2012-09-02T01:56:23+00:00 app[web.1]: 3: <head>
2012-09-02T01:56:23+00:00 heroku[router]: GET morning-inlet-9513.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=262ms status=500 bytes=643
2012-09-02T01:56:23+00:00 app[web.1]: 4: <title>GabisBag</title>
2012-09-02T01:56:23+00:00 app[web.1]:
2012-09-02T01:56:23+00:00 app[web.1]: 5: <%= stylesheet_link_tag "screen", :media => "screen" %>
2012-09-02T01:56:23+00:00 app[web.1]:
2012-09-02T01:56:23+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__1090905269972481286_30934000'
2012-09-02T01:56:23+00:00 app[web.1]: 6: <%= stylesheet_link_tag "landing_pages", :media => "screen" %>
2012-09-02T01:56:23+00:00 app[web.1]: 7: <%= javascript_include_tag "application" %>
2012-09-02T01:56:23+00:00 app[web.1]: 8: <%= csrf_meta_tags %>
2012-09-02T02:05:54+00:00 heroku[api]: Starting process with command `bundle exec rake assets:precompile` by jflores1#alumni.nd.edu
2012-09-02T02:05:57+00:00 heroku[run.1]: Awaiting client
2012-09-02T02:05:57+00:00 heroku[run.1]: Starting process with command `bundle exec rake assets:precompile`
2012-09-02T02:05:58+00:00 heroku[run.1]: State changed from starting to up
2012-09-02T02:06:14+00:00 heroku[run.1]: Client connection closed. Sending SIGHUP to all processes
2012-09-02T02:06:15+00:00 heroku[run.1]: Process exited with status 0
2012-09-02T02:06:15+00:00 heroku[run.1]: State changed from up to complete
2012-09-02T02:08:22+00:00 heroku[slugc]: Slug compilation started
2012-09-02T02:08:37+00:00 heroku[api]: D
eploy 6817a8e by jflores1#alumni.nd.edu
2012-09-02T02:08:37+00:00 heroku[api]: Release v8 created by jflores1#alumni.nd.edu
2012-09-02T02:08:38+00:00 heroku[web.1]: State changed from up to starting
2012-09-02T02:08:38+00:00 heroku[slugc]: Slug compilation finished
2012-09-02T02:08:40+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 42652 -e production`
2012-09-02T02:08:41+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-09-02T02:08:41+00:00 app[web.1]: Exiting
2012-09-02T02:08:42+00:00 heroku[web.1]: Process exited with status 0
2012-09-02T02:08:44+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2012-09-02T02:08:44+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2012-09-02T02:08:47+00:00 app[web.1]: => Booting Thin
2012-09-02T02:08:47+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:42652
2012-09-02T02:08:47+00:00 app[web.1]: => Call with -d to detach
2012-09-02T02:08:47+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-09-02T02:08:47+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2012-09-02T02:08:48+00:00 app[web.1]: >> Thin web server (v1.4.1 codename Chromeo)
2012-09-02T02:08:48+00:00 app[web.1]: >> Maximum connections set to 1024
2012-09-02T02:08:48+00:00 app[web.1]: >> Listening on 0.0.0.0:42652, CTRL+C to stop
2012-09-02T02:08:49+00:00 heroku[web.1]: State changed from starting to up
2012-09-02T02:08:50+00:00 app[web.1]: Started GET "/" for 108.210.1.241 at 2012-09-02 02:08:50 +0000
2012-09-02T02:08:50+00:00 app[web.1]:
2012-09-02T02:08:50+00:00 app[web.1]:
2012-09-02T02:08:50+00:00 app[web.1]: Processing by StaticPagesController#home as HTML
2012-09-02T02:08:50+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (9.3ms)
2012-09-02T02:08:50+00:00 app[web.1]: Completed 500 Internal Server Error in 77ms
2012-09-02T02:08:50+00:00 app[web.1]:
2012-09-02T02:08:50+00:00 app[web.1]: ActionView::Template::Error (screen.css isn't precompiled):
2012-09-02T02:08:50+00:00 app[web.1]: 2: <html>
2012-09-02T02:08:50+00:00 app[web.1]: 3: <head>
2012-09-02T02:08:50+00:00 app[web.1]: 4: <title>GabisBag</title>
2012-09-02T02:08:50+00:00 app[web.1]: 5: <%= stylesheet_link_tag "screen", :media => "screen" %>
2012-09-02T02:08:50+00:00 app[web.1]: 6: <%= stylesheet_link_tag "landing_pages", :media => "screen" %>
2012-09-02T02:08:50+00:00 app[web.1]: 7: <%= javascript_include_tag "application" %>
2012-09-02T02:08:50+00:00 app[web.1]: 8: <%= csrf_meta_tags %>
2012-09-02T02:08:50+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__3619394764979485472_40067220'
2012-09-02T02:08:50+00:00 app[web.1]:
2012-09-02T02:08:50+00:00 app[web.1]:
2012-09-02T02:08:50+00:00 heroku[router]: GET morning-inlet-9513.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=221ms status=500 bytes=643
2012-09-02T02:14:08+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by jflores1#alumni.nd.edu
2012-09-02T02:14:10+00:00 heroku[run.1]: Awaiting client
2012-09-02T02:14:10+00:00 heroku[run.1]: Starting process with command `bundle exec rake db:migrate`
2012-09-02T02:14:11+00:00 heroku[run.1]: State changed from starting to up
2012-09-02T02:14:17+00:00 heroku[run.1]: Client connection closed. Sending SIGHUP to all processes
2012-09-02T02:14:18+00:00 heroku[run.1]: Process exited with status 0
2012-09-02T02:14:18+00:00 heroku[run.1]: State changed from up to complete
2012-09-02T02:14:35+00:00 app[web.1]:
2012-09-02T02:14:35+00:00 app[web.1]: Started GET "/" for 108.210.1.241 at 2012-09-02 02:14:35 +0000
2012-09-02T02:14:35+00:00 app[web.1]:
2012-09-02T02:14:35+00:00 app[web.1]: Processing by StaticPagesController#home as HTML
2012-09-02T02:14:35+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (0.5ms)
2012-09-02T02:14:35+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms
2012-09-02T02:14:35+00:00 app[web.1]:
2012-09-02T02:14:35+00:00 app[web.1]: ActionView::Template::Error (screen.css isn't precompiled):
2012-09-02T02:14:35+00:00 app[web.1]: 2: <html>
2012-09-02T02:14:35+00:00 app[web.1]: 3: <head>
2012-09-02T02:14:35+00:00 app[web.1]: 4: <title>GabisBag</title>
2012-09-02T02:14:35+00:00 app[web.1]: 5: <%= stylesheet_link_tag "screen", :media => "screen" %>
2012-09-02T02:14:35+00:00 app[web.1]: 6: <%= stylesheet_link_tag "landing_pages", :media => "screen" %>
2012-09-02T02:14:35+00:00 app[web.1]: 7: <%= javascript_include_tag "application" %>
2012-09-02T02:14:35+00:00 app[web.1]: 8: <%= csrf_meta_tags %>
2012-09-02T02:14:35+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__3619394764979485472_40067220'
2012-09-02T02:14:35+00:00 app[web.1]:
2012-09-02T02:14:35+00:00 app[web.1]:
2012-09-02T02:14:35+00:00 heroku[router]: GET morning-inlet-9513.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=11ms status=500 bytes=643
This looks like the important part:
ActionView::Template::Error (screen.css isn't precompiled):
Seems as though this thread will fix your problem.
As it says:
On heroku server (readonly filesystem), If you want runtime compilation of css (its not recommended but you can do it), make sure you have done settings like below -
# inside config/application.rb
config.assets.enabled = true
config.assets.prefix = Rails.root.join('tmp/assets').to_s
# If you are using sass then keep gem outside of asset group
gem 'sass-rails', '3.1.4'
# inside config/environments/production.rb
config.assets.compile = true
I found the answer here: blueprint css rails 3.1 help
So far as I can tell, this appears to be a problem with using the Blueprint CSS Framework. That said, two other notes:
I commented out the <%= stylesheet_link_tag "screen", :media=>"screen"%> code from my application.html.erb layout file.
I didn't have 'rubyracer' gem installed. I installed it because it was in the gem profiled of the referenced answer. I have no clue what it does.
The URL slashes ("/") are now showing up again wherever I have links. My hunch is that it's something in one of the CSS files that I'm just going to have to dive into and debug. But, the whole reason I had the stylesheet_link_tag thing in the first place was because I was trying to get rid of those pesky slashes. Ultimately, I decided deployment was more important.
Hope this is helpful to someone else!
Here's how I ultimately solved the problem(s). Thanks to the folks who referred me elsewhere so that I could put it all together.
First, I moved Blueprint to a vender directory. I don't think that's crucial to the solution, but it felt cleaner.
The compilation problem:
This thread: blueprint css rails 3.1 help was really helpful. I found Martin and Gary's responses (nos 2 and 3) more helpful than the selected response.
Part of why I was having trouble with compilation (personally) is because I made some edits to the Blueprint files, which meant that they needed to be compiled again before deployment.
This thread: rails 3.1.0 ActionView::Template::Error (application.css isn't precompiled) was helpful in that regard. Basically, just run "Bundle exec rake assets:precompile" before uploading to heroku. I also run "heroku run rake assets:precompile" after upload.
How I got rid of the URL slashes in my links:
The URLs are the result of this code in Blueprint/print.css:
a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;}
a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;}
I solved the problem by commenting out that code. Of course, after changing the file, you have to rake assets:precompile again. But, that got it all working!

Rails: Why doesnt all my scss files get compiled?

I am a beginner in rails, and I reckon I haven't got a clear idea on to how the stylesheets should be organised. Currently, I have two files in my assets/stylesheets:
application.css
home.css
When I run rake assets:precompile - I realise that only application.css is compiled into my public/assets folder. What about home.css?
More Info
I want home.css to load only when the respond is received from my home controller. I have removed *= require_tree . from application.css (since I am guessing that home.css would be included in all other pages - am I right?)
The reason I am trying to figure out a solution for this is because heroku throws the following error:
ActionView::Template::Error (home.css isn't precompiled):
2012-04-29T10:48:20+00:00 app[web.1]: 5: <meta name="viewport" content="width=device-width">
2012-04-29T10:48:20+00:00 app[web.1]: 7: = stylesheet_link_tag "application"
2012-04-29T10:48:20+00:00 app[web.1]: 6: = javascript_include_tag "application"
2012-04-29T10:48:20+00:00 app[web.1]: 8: = stylesheet_link_tag params[:controller]
2012-04-29T10:48:20+00:00 app[web.1]: 9: = javascript_include_tag [:controller]
2012-04-29T10:48:20+00:00 app[web.1]: 10: = csrf_meta_tags
2012-04-29T10:48:20+00:00 app[web.1]: 11: %body
2012-04-29T10:48:20+00:00 app[web.1]:
2012-04-29T10:48:20+00:00 app[web.1]: app/views/layouts/application.haml:8:in `_app_views_layouts_application_haml__2082158123561350666_35885340'
2012-04-29T10:48:20+00:00 app[web.1]: cache: [GET /] miss
Any ideas what the problem/mistake is? Thanks!
By default only application.css is compile (see the guide). If you want to change what is precompiled, change config.assets.precompile in application.rb, for example
config.assets.precompile += ['home.css']

Heroku deploy fails after upgrading to bootstrap 2.0.1 via twitter-bootstrap-rails gem

UPDATE:
this error is shown during git push heroku master :
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
couldn't find file 'twitter/bootstrap'
(in /tmp/build_2pmsvze33th3e/app/assets/javascripts/application.js:9)
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
Precompiling assets failed, enabling runtime asset compilation
Injecting rails31_enable_runtime_asset_compilation
Please see this article for troubleshooting help:
http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting
I upgraded Bootstrap 2 layout to 2.0.1 by following this guide. After that I get this error deploing to Heroku :
2012-02-23T23:12:09+00:00 app[web.1]: ActionView::Template::Error ('twitter/bootstrap.less' wasn't found.
2012-02-23T23:12:09+00:00 app[web.1]:
2012-02-23T23:12:09+00:00 app[web.1]: (in /app/app/assets/stylesheets/bootstrap.css.less)):
2012-02-23T23:12:09+00:00 app[web.1]: 7: /%title gitwatcher.com
2012-02-23T23:12:09+00:00 app[web.1]: 8: = csrf_meta_tags
2012-02-23T23:12:09+00:00 app[web.1]: 9: = stylesheet_link_tag "vendor", :media => "screen"
2012-02-23T23:12:09+00:00 app[web.1]: 10: = stylesheet_link_tag "application", :rel => "stylesheet"
2012-02-23T23:12:09+00:00 app[web.1]: 11: = stylesheet_link_tag "http://jqueryui.com/repository/tags/latest/themes/base/jquery.ui.all.css", :media => "screen, projection"
2012-02-23T23:12:09+00:00 app[web.1]: 12: /
2012-02-23T23:12:09+00:00 app[web.1]: 13: :css
2012-02-23T23:12:09+00:00 app[web.1]: app/views/layouts/application.html.haml:10:in `_app_views_layouts_application_html_haml___2608554683581233975_52490540'
2012-02-23T23:12:09+00:00 app[web.1]:
2012-02-23T23:12:09+00:00 app[web.1]:
2012-02-23T23:12:09+00:00 app[web.1]: cache: [GET /] miss
2012-02-23T23:12:09+00:00 app[web.1]: Processing by HomeController#index as HTML
2012-02-23T23:12:09+00:00 app[web.1]: Rendered shared/_watch-list-tab.html.haml (4.5ms)
2012-02-23T23:12:09+00:00 app[web.1]: Rendered shared/_watch-list-table.html.haml (30.2ms)
2012-02-23T23:12:09+00:00 app[web.1]: Rendered home/index.html.haml within layouts/application (101.7ms)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled vendor.css (3ms) (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled css3-github-buttons/gh-buttons.css (0ms) (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled jquery_carousel/carousel.css (0ms) (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled application.css (2ms) (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Completed 500 Internal Server Error in 858ms
Previously I got an existing Rails 3.1.3 app already working with Bootstrap 2 layout on Heroku Cedar.
Any idea ?
Remove the following file app/assets/stylesheets/bootstrap.css.less and enjoy.
Soruce https://github.com/seyhunak/twitter-bootstrap-rails/issues/123
I also moved gem "twitter-bootstrap-rails" outside the assets group and that works!
I was able to fix this issue by simply moving gem "twitter-bootstrap-rails" out of the :assets block and putting it at the top of my gemfile.
Solved.
Simply by comment out the following line in Gemfile :
#gem 'twitter-bootstrap-rails', :git => 'http://github.com/seyhunak/twitter-bootstrap-rails.git'
and using gem "twitter-bootstrap-rails", "~> 2.0.1.0" then running bundle update
To be complete, my previous failing branch was :
- revision: a5d67d23afeaa76eb52c6f87d55ff407f9c753f2
- twitter-bootstrap-rails (2.0.1)
For me the solution was to remove this line in application.css
*= require twitter/bootstrap
Se https://github.com/seyhunak/twitter-bootstrap-rails/issues/123
Another workaround for errors during runtime asset compilation is to use the asset_sync gem.

Heroku help: ActionView::Template::Error (Permission de nied

I get this error on heroku:
2011-06-01T09:13:29+00:00 app[web.1]: Started GET "/" for MYIP at 2011
-06-01 11:13:29 +0200
2011-06-01T09:13:29+00:00 app[web.1]:
2011-06-01T09:13:29+00:00 app[web.1]: ActionView::Template::Error (Permission de
nied - /app/public/javascripts/.permissions_check.6011580.1.163351):
2011-06-01T09:13:29+00:00 app[web.1]: 19: <meta http
-equiv="Content-type" content="text/html; charset=utf-8" />
2011-06-01T09:13:29+00:00 heroku[router]: GET www.vinderhimlen.dk/ dyno=web.1 qu
eue=0 wait=0ms service=476ms bytes=934
2011-06-01T09:13:29+00:00 app[web.1]: 20: <% end %>
2011-06-01T09:13:29+00:00 app[web.1]: 21: <%= stylesheet_lin
k_tag "public", "rateit" %>
2011-06-01T09:13:29+00:00 app[web.1]: 22: <%= javascript_inc
lude_tag 'rails.js', 'jquery.js', 'vis.js', 'jquery.rateit.js', :cache => true %
>
2011-06-01T09:13:29+00:00 app[web.1]: 23: <scri
pt type="text/javascript">
2011-06-01T09:13:29+00:00 app[web.1]: 24: $(document).ready(function() {
2011-06-01T09:13:29+00:00 app[web.1]: 25:
2011-06-01T09:13:29+00:00 app[web.1]: app/views/layouts/application.html.erb:2
2:in `_app_views_layouts_application_html_erb__1541079903689551625_21945980__132
3620808994783512'
2011-06-01T09:13:29+00:00 app[web.1]:
2011-06-01T09:13:29+00:00 app[web.1]:
2011-06-01T09:13:29+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-06-01T09:13:29+00:00 app[web.1]: >> Stopping ...
2011-06-01T09:13:29+00:00 heroku[web.1]: Process exited
Iceberg#ICEBERG-PC /c/rails/konkurranceportalen (master)
$
Your application is attempting to compile your javascript files into one and then cache it on the disk, which Heroku won't allow as it does not allow write access to disk. Remove the :cache => true from your javascript_include_tag line and find an alternate method to doing this for Heroku.

Resources