take056553 (10) [Avatar] Offline
#1
Due to the errata here(http://manning.com/katz/errata.html) that we should precompile before ran the production mode, but when I ran

rake db:migrate RAILS_ENV=production && rake assets:precompile && rails s -e production

it signals an error:

------------------------------------------------------------------------------------------------
rake aborted!
projects isn't precompiled
(in /Users/Mac/projects/rails-in-action/ticketee/app/assets/stylesheets/projects.css.scss)

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
------------------------------------------------------------------------------------------------

The first thing I do is to use the --trace option, but same output. Then I check this file: projects.css.scss, there is nothing there except 3 lines of comment.

I also tried bundle exec rake assets:precompile, not working.
config.assets.compile = true works but I'm wondering why

rake assets:precompile is failing.

Any clues?

Thanks
take056553 (10) [Avatar] Offline
#2
Re: 4.3.3, Page 94 Precompile
More info about this bug:

Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError in Projects#index

Showing /Users/Mac/projects/rails-in-action/ticketee/app/views/layouts/application.html.erb where line #5 raised:

application.css isn't precompiled
Extracted source (around line #5):

2: <html>
3: <head>
4: <title><%= title %></title>
5: <%= stylesheet_link_tag "application" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
Rails.root: /Users/Mac/projects/rails-in-action/ticketee

Application Trace | Framework Trace | Full Trace
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__1345753990476662772_2175276680'
take056553 (10) [Avatar] Offline
#3
Re: 4.3.3, Page 94 Precompile
If I remove projects.css.scss, it works fine.
but I will need projects.css.scss later on.
Still can't figure out how to solve this.
No useful traces while ran:

rake assets:precompile --trace

- - - - - - - - - - - - Erro Message - - - - - - - - - - - - - - -
rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
mkdir -p /Users/Mac/projects/rails-in-action/ticketee/public/assets
mkdir -p /Users/Mac/projects/rails-in-action/ticketee/public/assets
mkdir -p /Users/Mac/projects/rails-in-action/ticketee/public/assets
mkdir -p /Users/Mac/projects/rails-in-action/ticketee/public/assets
rake aborted!
projects isn't precompiled
(in /Users/Mac/projects/rails-in-action/ticketee/app/assets/stylesheets/projects.css.scss)

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Any hints, possible ways to fix this ?_?
tllucero (4) [Avatar] Offline
#4
Re: 4.3.3, Page 94 Precompile
This order got me to green in Rails 3.2:

edit app/views/projects/_form.html.erb
<%= form_for (@project) do |f| %>
<% @project.errors.full_messages.each do |msg| %>

<%= msg %>


<% end %>


<%= f.label :name %>
<%= f.text_field :name %>


<%= f.submit %>
<% end %>

rake db:migrate RAILS_ENV=production
bundle exec rake assets:precompile
tests run green

However, when I go
rails server -e production
clicking on "Delete Project" does not bring up confirm message

and
rails server
clicking on "Delete Project" brings up confirm message twice! (deleted after first OK)

I dislike mysteries.

Also, if someone can tell me why my line-ends aren't registering (from Linux) I'd like to know.
tllucero (4) [Avatar] Offline
#5
Re: 4.3.3, Page 94 Precompile
this order got me to green in Rails 3.2:

edit app/views/projects/_form.html.erb

<%= form_for (@project) do |f| %>
<% @project.errors.full_messages.each do |msg| %>
<p><%= msg %></p>
<% end %>
<p>
<%= f.label :name %>
<%= f.text_field :name %>
</p>
<%= f.submit %>
<% end %>

rake db:migrate RAILS_ENV=production
bundle exec rake assets:precompile
tests run green

However, when I go
rails server -e production
clicking on "Delete Project" does not bring up confirm message

and
rails server
clicking on "Delete Project" brings up confirm message twice! (deleted after first OK)

I dislike mysteries.