Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

So far here's what I've done.

  1. I loaded assets in the Capfile: js still not working http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

  2. I moved coffee-rails from the assets to the main section: still not working

    gem 'coffee-rails', '~> 3.2.1'

    group :assets do gem 'sass-rails', '~> 3.2.3' end

UPDATE

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html"; charset=utf-8" />
        <title>liquid.radio - liquidbroadcasting.de</title>
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

            <link href='http://fonts.googleapis.com/css?family=Irish+Grover' rel='stylesheet' type='text/css'>
            <link href='http://fonts.googleapis.com/css?family=La+Belle+Aurore' rel='stylesheet' type='text/css'>

        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js" type="text/javascript"></script>
        <link rel="shortcut icon" href="favicon.ico" />
        <link href="/assets/jplayer.blue.monday.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/assets/jquery.jplayer.min.js"></script>

        <script type="text/javascript" src="http://dhienterprises.com/js/socialist/jquery.socialist.js"></script>

            <link href="http://dhienterprises.com/js/socialist/jquery.socialist.css" rel="stylesheet" />

As you can see I'm not even getting most of the stuff from Assets. It just won't load. Not even from an external site. The one thing I am getting from assets says that it's not found. But I don't see why the other two scripts aren't being loaded...

UPDATE: Production Environment

LiquidAdmin::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # Code is not reloaded between requests
  config.cache_classes = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true
  Paperclip.options[:command_path] = "/usr/bin/"
  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = false

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

  # Generate digests for assets URLs
  config.assets.digest = true

  # Defaults to nil and saved in location specified by config.assets.prefix
  # config.assets.manifest = YOUR_PATH

  # Specifies the header that your server uses for sending files
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  # config.force_ssl = true

  # See everything in the log (default is :info)
  # config.log_level = :debug

  # Prepend all log lines with the following tags
  # config.log_tags = [ :subdomain, :uuid ]

  # Use a different logger for distributed setups
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found)
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners
  config.active_support.deprecation = :notify

  # Log the query plan for queries taking more than this (works
  # with SQLite, MySQL, and PostgreSQL)
  # config.active_record.auto_explain_threshold_in_seconds = 0.5
end

Everything else is pretty much default/commented out

share|improve this question
    
What do you mean when you say that js is not working? Your js files are not loaded compiled js file or something else? –  Fenec Jul 21 '13 at 9:41
    
I'm loading all the js from at outside server. For example I'm loading jquery from google and I'm loading another script from another server and neither one of them is showing up in production. Both are showing up in dev. I'll update my post. –  mystic cola Jul 21 '13 at 15:02
    
What does the setup of your production environment look like? –  tyler Jul 21 '13 at 16:01
    
Ok. I'll post that in one sec. –  mystic cola Jul 21 '13 at 17:02
    
Updated with production environment. –  mystic cola Jul 21 '13 at 17:09

2 Answers 2

up vote 2 down vote accepted

EDIT: After talking over chat, it was a problem about including jquery twice in the page.

After checking your page (liquid-radio.com), I have seen a great error imo:

<!DOCTYPE html>
<html>
<head>
  <title>liquid.radio</title>
  <link href="/assets/application-c9ed21e2be2e7bb9955d6a0d89357d16.css" media="all" rel="stylesheet" type="text/css" />
  <script src="/assets/application-09500810259983928e0b1b4d46b49071.js" type="text/javascript"></script>
  <meta content="authenticity_token" name="csrf-param" />
<meta content="MYdcXuDSzYg1qSHrRwx0y0VK5VmqhWmLLGiYSOX7pOI=" name="csrf-token" />
</head>
<body style="background: #FFF;">

<!DOCTYPE html>
<html>
    <head>

You have the first part repeated a couple of times, rendering your html invalid.

share|improve this answer
    
I didn't actually... That's the application.html.erb... (which I only discovered existed last night.) Hmm... So it seems I'll have to copy and paste my header and footer there (which will save me a pain in the ass anyway.) I'll report back with what happens. –  mystic cola Jul 22 '13 at 14:38
    
Nope! I updated the application.html.erb and included all the info I had been putting on the pages... It still isn't loading the javascript. In fact... if you go to the page right now (I'll probably change it soon) I'm even calling up one of the scripts right on the application.html.erb and it's still not working... –  mystic cola Jul 23 '13 at 7:51
    
Do you mind sharing both application.html.erb and the root view code? Or even better, a link to the repo if this is opensourced –  Juan Guerrero Jul 23 '13 at 8:59
    
@mysticcola Checking your page's source code again, I found that you are including jquery twice(one inside application.js, probably through jquery-rails gem, and another one from google cdn). Also, you have 2 body opening tags. Anywhere I can hit you up personally (skype, whatever), as this isn't a problem about javascript anymore? –  Juan Guerrero Jul 23 '13 at 9:27
    
There's actually a chat built into StackOverflow... but I have no idea how to use it. :) I used it once though. But hit me up on Yahoo messenger if you have it. The name is mysticcola –  mystic cola Jul 23 '13 at 9:41

Fixed! Switched:

config.assets.compile = false

to:

config.assets.compile = true

Now it works.

share|improve this answer
1  
This isn't the best way, as it means that you can probably recompile assets on production if you aren't careful. It's better to use rake assets:precompile before deploying to production. –  Juan Guerrero Jul 21 '13 at 18:48
    
Well I tried that Juan... nothing happened. I tried that, I tried everything you see above... It's a really weird problem to have. I don't understand why it does this. –  mystic cola Jul 22 '13 at 10:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.