Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8067029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:09:49+00:00 2026-06-05T12:09:49+00:00

I’m trying to deploy a Rails 3 app which includes jQuery Mobile. It works

  • 0

I’m trying to deploy a Rails 3 app which includes jQuery Mobile. It works fine in development, and I understand that it needs to precompile the JS and CSS for production. I’m getting the following error:

Started GET "/orders/mobile" for 127.0.0.1 at Wed Jun 06 14:22:40 -0400 2012
Processing by OrdersController#mobile as HTML
  Rendered orders/mobile.html.erb within layouts/mobile (642.9ms)
Completed 500 Internal Server Error in 1122ms

ActionView::Template::Error (jquery.mobile isn't precompiled):
5: <head>
6:   <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7:   <title>Company Orders</title>
8:   <%= stylesheet_link_tag 'jquery.mobile' %>
9:   <%= stylesheet_link_tag 'jquery.mobile.structure' %>
10:   <%= stylesheet_link_tag 'jquery.mobile.theme' %>
11:     <%= stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Ubuntu' %>
app/views/layouts/mobile.html.erb:8:in `_app_views_layouts_mobile_html_erb__605278794_69818059003840'
app/controllers/orders_controller.rb:330:in `mobile'
app/controllers/orders_controller.rb:329:in `mobile'

I’ve read the usual stuff, but there are so many things wrong here, I hardly know where to start:

  1. I had the JQM stuff in app/assets, but have since moved them to vendor/assets. They get seen by the precompiler — I know because it will complain about them on various tries — but they never seem to get precompiled (in either location).
  2. I’ve tried *= require_tree ../../../vendor/assets/stylesheets in application.css. I don’t really want it included in every page hit, so I’d like to include it in the layout, but I’m just trying to get it precompiled somehow.
  3. I’ve tried *= require jquery.mobile[[.css].erb] in application.css.
  4. I’ve tried config.assets.precompile += %w( [[./]vendor/assets/stylesheets/]jquery.mobile.* ) in config/environments/production.rb.

As a last-ditch effort, I’ve removed the “.erb” from jquery.mobile.css.erb, and removed the <% asset_data_uri %> tags to see if it would compile. It passes the rake assets:precompile command, but still gives me the same error.

I don’t want to turn off precompiling for JQM; I want it to work. (I really need to speed this page up.) However, I can’t find any guide on how to get JQM elegantly inserted into a Rails 3 app (with precompiling), and I’ve exhausted every avenue I can think of in trial and error. Surely someone has done this and knows the right way to go about it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:09:50+00:00Added an answer on June 5, 2026 at 12:09 pm

    My fundamental problem here is that I need to have some assets precompiled for production, but NOT included in every page hit. Here’s what I’ve figured out:

    If I didn’t mind JQM being served with every page, I could either put the files in app/assets and let require_tree . do its magic, or leave those files in vendor/assets, and require them individually in application.js. If I want to put them in vendor/assets and NOT specifically require them in application.js, I can use config.assets.paths << "#{Rails.root}/vendor/assets" in production.rb, and (apparently) require_tree in application.js will process this tree as well. This still rolls them up into the compiled application JS “ball,” but leaves them distinct on the filesystem.

    The proper way to incorporate jQuery Mobile for specific pages — and keep its files separated in vendor/assets — seems to be to use both a config.assets.paths << "#{Rails.root}/vendor/assets" directive and a config.assets.precompile += %w( jquery.mobile.* ) directive. This will get the JQM files precompiled, but NOT rolled up into application-(hash).js and application-(hash).css. (They’ll be individual files in public/assets.) Then you can do specific javascript_include_tag‘s and stylesheet_link_tag‘s in a layout specially for mobile views.

    Big finish: I had upgraded to Rails 3.2.5 because I saw some security report on 3.2.3. I rolled back to 3.2.3 and — incorporating what I learned above — I was able to finally get it working. I also tried 3.2.4. Apparently there’s a regression in > 3.2.3 that interferes with precompiling.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.