msjit / testcasedb

TestCaseDB - Web based test case management
MIT License
40 stars 18 forks source link

ActionView::Template::Error (application.css isn't precompiled) #17

Closed harshith30 closed 10 years ago

harshith30 commented 10 years ago

Hi, After starting the rails server in production environment and try to access localhost i get the following error screenshot from 2014-06-27 21 32 54


I'm getting this error after the recent patch which resolved all the issues regarding "google_auth_enable ".

The error message which i get in my terminal after opening localhost in browser is as follows.


[root@localhost testcasedb]# bundle exec rails server -e production

[2014-06-27 21:40:25] INFO WEBrick 1.3.1 [2014-06-27 21:40:25] INFO ruby 1.9.3 (2014-05-14) [x86_64-linux] [2014-06-27 21:40:25] INFO WEBrick::HTTPServer#start: pid=3392 port=3000 Started GET "/" for 127.0.0.1 at 2014-06-27 21:40:41 +0530 Processing by HomeController#index as HTML Redirected to http://localhost:3000/login?referer=%2F Filter chain halted as :require_login rendered or redirected Completed 302 Found in 2ms (ActiveRecord: 0.0ms) Started GET "/login?referer=%2F" for 127.0.0.1 at 2014-06-27 21:40:41 +0530

ActionView::Template::Error (application.css isn't precompiled): 2: 3: 4: Test Case DB 5: <%= stylesheet_link_tag "application", :media => "all" %> 6: <%= javascript_include_tag "application" %> 7: <%= csrf_meta_tags %> 8: app/views/user_sessions/new.html.erb:5:in _app_views_user_sessions_new_html_erb___1166241334460544823_38795020' app/controllers/user_sessions_controller.rb:10:innew'

Processing by UserSessionsController#new as HTML Parameters: {"referer"=>"/"} Rendered user_sessions/new.html.erb (74.6ms) Completed 500 Internal Server Error in 123ms


Out of curiosity the file user_sessions_controller.rb was mentioned in my error message and the file looks as below

screenshot from 2014-06-27 21 55 07

In the file the following lines of code render :layout = > false, could this be the reason for the error message?

def new @user_session = UserSession.new render :layout => false end


joffems commented 10 years ago

The issue is mentioned here, ActionView::Template::Error (application.css isn't precompiled).

It looks like your assets aren't pre-compiled. Please run, 'rake assets:precompile RAILS_ENV=production'

If the assets don't compile, please attach the output of that command in this ticket.

harshith30 commented 10 years ago

Hi, It was as you said the application is not precompiled and it aborts when i try to do so using rake stating rake aborted .

[harshith@localhost tcdb]$ bundle exec rake assets:precompile RAILS_ENV="production" --trace

WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/usr/local/bin/ruby /usr/local/bin/rake assets:precompile:all RAILS_ENV=production   
RAILS_GROUPS=assets --trace

WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1
 ** Invoke assets:precompile:all (first_time) 
 ** Execute assets:precompile:all
 ** Invoke assets:precompile:primary (first_time)
 ** Invoke assets:environment (first_time)
 ** Execute assets:environment
 ** Invoke environment (first_time)
 ** Execute environment
 ** Invoke tmp:cache:clear (first_time)
 ** Execute tmp:cache:clear
 ** Execute assets:precompile:primary
 rake aborted!
 'fontawesome.less' wasn't found.

 (in /home/harshith/tcdb/tcdb/app/assets/stylesheets/bootstrap_and_overrides.css.less)at   
  less.Parser.parser.parse.i (/usr/local/lib/ruby/gems/1.9.1/gems/less-2.3.2/lib/less/js/lib/less
  /parser.js:426:69)

  /usr/local/lib/ruby/gems/1.9.1/gems/less-2.3.2/lib/less/parser.rb:100:in `block in to_css'
  /usr/local/lib/ruby/gems/1.9.1/gems/less-2.3.2/lib/less/java_script/v8_context.rb:90:in `block in    
  \do_lock'
  /usr/local/lib/ruby/gems/1.9.1/gems/less-2.3.2/lib/less/java_script/v8_context.rb:88:in `call'
  .
  .
  /usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
  /usr/local/bin/rake:23:in `load'
  /usr/local/bin/rake:23:in `<main>'
  Tasks: TOP => assets:precompile:primary
   rake aborted!
   Command failed with status (1): [/usr/local/bin/ruby /usr/local/bin/rake as...]
    /usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:55:in `block in   
    create_shell_runner'
    /usr/local/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/file_utils.rb:45:in `call'
    .
    . 
    /usr/local/bin/rake:23:in `load'
    /usr/local/bin/rake:23:in `<main>'
    Tasks: TOP => assets:precompile

  [harshith@localhost tcdb]$ which rake
  /usr/local/bin/rake

If there is need for additional information . I' happy to provide them.
harshith30 commented 10 years ago

Hi, I did some searches regarding the 'fontawesome.less' wasn't found issue and found the following link,


     https://github.com/seyhunak/twitter-bootstrap-rails/issues/588

      The bootstrap_and_overrides.css looks like as follows

       // Set the Font Awesome (Font Awesome is default. You can disable by commenting below 
       lines)
       // Note: If you use asset_path() here, your compiled bootstrap_and_overrides.css will not
       //       have the proper paths. So for now we use the absolute path.
       @fontAwesomeEotPath: asset-path("fontawesome-webfont.eot?v=3.0.2");
       @fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot?#iefix&v=3.0.2");
       @fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff?v=3.0.2");
       @fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf?v=3.0.2");

        // Font Awesome
       @import "fontawesome";

In the terminal error message this path has been mentioned

/usr/local/lib/ruby/gems/1.9.1/gems/less-2.3.2/....../parser.js    and the contents of 
that line looks  as follows

  if ((importError = parser.imports.error)) { 
       // Check if there was an error during importing
                    if (importError instanceof LessError) throw importError;
                    else         throw new(LessError)(importError, env);
                }

   Could this be the reason for the error which I'm facing .
kirantpatil commented 10 years ago

assets precompile properly in my machine

testcasedb$ ruby -v ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-linux]

My recommendation:

  1. Install testcasedb in your user home directory not in root
  2. create db user and password and database within it
  3. modify the database.yml file in config directory for either production or development

This should work without any modification

joffems commented 10 years ago

The file bootstrap_and_overrides.css was removed from the codebase in September 2013.

How did you originally download the application? Did you use the download on testcasedb.com or did you do a git pull? Also, have you updated the code with additional git pulls?

Finally, can you provide the first 30 lines of the commands, 'git diff' and 'git status'.

harshith30 commented 10 years ago

Hi, The issue got resolved , i was using an older version of testcasedb. thank you for your time.

Thanks harshith