vertmac / designmodo-startup_framework-rails

A gem to integrate designmodo Startup Framework in Rails
BSD 2-Clause "Simplified" License
36 stars 5 forks source link

Getting this to work in production? #4

Open topherreynoso opened 10 years ago

topherreynoso commented 10 years ago

Hello,

I have a ruby (2.0.0) rails app (4.0.3) running this gem happily in development following your instructions (although a couple of the templates are not functioning, the modules I use are working properly, thankfully). I am now trying to push this all up to my ubuntu apache server using capistrano and I cannot get these assets to work properly. I suspect it has much to do with the fact that I had to switch over to LESS in order to use this gem and that I am using two very different styles now (one for the static pages following the designmodo-startup style and the rest of my app follows my own).

In production, none of the styles appear properly and the console says that it cannot find the corresponding css files.

Here is my file structure: app --assets ----stylesheets ------application.css ------custom.less ------startup_framework.less ------static_pages.less

application.css:

/*
  *= require_self
  *= require bootstrap_and_overrides
  *= require jquery.ui.all
  *= require font-awesome
*/

static_pages.less:

@import 'startup_framework';
@startup-basePath: "/startup-framework/";

/* header */
@import '/startup-framework/ui-kit/ui-kit-header/less/header-10.less';

/* content */
@import '/startup-framework/ui-kit/ui-kit-content/less/content-4.less';
@import '/startup-framework/ui-kit/ui-kit-content/less/content-10.less';
@import '/startup-framework/ui-kit/ui-kit-content/less/content-12.less';
@import '/startup-framework/ui-kit/ui-kit-content/less/content-22.less';
@import '/startup-framework/ui-kit/ui-kit-content/less/content-35.less';

/* contacts */
@import '/startup-framework/ui-kit/ui-kit-contacts/less/contact-1.less';

/* footer */
@import '/startup-framework/ui-kit/ui-kit-footer/less/footer-1.less';
...

application.html.erb

<html>
  <head>
    ...
    <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
    <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
    <% if params[:controller] != "static_pages" %>
      <%= stylesheet_link_tag "custom" %>
    <% else %>
      <%= stylesheet_link_tag "static_pages" %>
    <% end %>
    ...
  </head>
  ...
</html>

Finally, I am precompiling these assets in the production.rb environment (config.assets.js_compressor is set to uglifier but no compression is set for css and I have not declared any config.less.paths:

MyApp::Application.configure do
  ...
  config.assets.precompile += %w( custom.less )
  config.assets.precompile += %w( startup_framework.less )
  config.assets.precompile += %w( static_pages.less )
  ...
end

Has anyone had any luck deploying to a production server with this gem?