Code Monkey home page Code Monkey logo

Comments (14)

le0pard avatar le0pard commented on July 27, 2024

In nginx you can use this

location ~* ^.+\.(js|css|jpg|jpeg|gif|png|svg|ico||mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|flv|swf|avi|mp4)$ {
    root /var/.../current/public;
    access_log   off;
    expires      30d;
    add_header  Cache-Control  private;
    error_page 404 = @fallback;
}
location @fallback {
    proxy_pass http://monkey_prod_unicorn;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
}

from mongodb_logger.

aja avatar aja commented on July 27, 2024

why not use the standard assets folder setup so assets compile can grab all mongodb_logger assets and include them in the app automatically?

from mongodb_logger.

le0pard avatar le0pard commented on July 27, 2024

maybe, but this folder should be with fix name. Is it good for you?

from mongodb_logger.

aja avatar aja commented on July 27, 2024

Usually when I use a rails engine, it automatically includes assets within
it in my app's assets folder. So, I thought this is best way to include
assets. However, you might have other concerns which I don't know.

On Jun 5, 2012, at 6:14 PM, Alexey <
[email protected]>
wrote:

maybe, but this folder should be with fix name. Is it good for you?


Reply to this email directly or view it on GitHub:
#36 (comment)

from mongodb_logger.

le0pard avatar le0pard commented on July 27, 2024

ok, I will looking on solutions.

from mongodb_logger.

le0pard avatar le0pard commented on July 27, 2024

Hello, aja. Please, try new version with assets pipeline support. Add into Gemfile:

gem 'mongodb_logger', :git => 'git://github.com/le0pard/mongodb_logger.git', :branch => 'development'

And run "bundle". If all will be good - I will release new version.

from mongodb_logger.

aja avatar aja commented on July 27, 2024

Rails.application.config.assets.paths now shows the engine's assets paths correctly. However, now the assets aren't loaded correctly in development nor production. I see the page is linking to "mongodb_logger-125e8e72b7393e4a4e3e3d3211a6cb27.js", as an example, in development which doesn't exist and in production which is not being generated. I wonder how is it working for you in all environments? maybe I'm doing something incorrectly. Also, there might be a conflict in css/js files as I have jquery in my app and have layout.css.scss and so on.

from mongodb_logger.

le0pard avatar le0pard commented on July 27, 2024

http://demo-mongodb-logger.catware.org - this is example working on heroku with assets pipeline. Also on my local mashine in dev mode all js/css loaded corectly. This files not generated in public directory, its proxy by sprokets gem.

from mongodb_logger.

le0pard avatar le0pard commented on July 27, 2024

Ok, lets try another solution. Please, add this task on deploy (before restart):

bundle exec rake mongodb_logger:assets:compile[public/assets]

from mongodb_logger.

le0pard avatar le0pard commented on July 27, 2024

Or event better. Add this to config/deploy.rb:

require 'mongodb_logger/capistrano' 

from mongodb_logger.

aja avatar aja commented on July 27, 2024

I tried the latest and looks like you are getter closer. Though, even in development now it doesn't work I get the following error:

Started GET "/assets/mongodb_logger-2d8ad697f60c84620718293ae4c34951.css" for 127.0.0.1 at 2012-06-10 21:49:13 +0300
Error compiling asset mongodb_logger.css:
Sass::SyntaxError: Undefined mixin 'border-radius'

border-radius is a sass mixin that I defined in my application.css and is used in layout.css. When I define the mixin in layout it works but complain about another mixin called box-shadow. So, it seems like there is a conflict in loading libraries. I'm using twitter-bootstrap also. This is with regard to development env which used to work before.

As for the new rake task when I execute:

bundle exec rake mongodb_logger:assets:compile[public/assets]

I get:

No such file or directory - public/assets/mongodb_logger-125e8e72b7393e4a4e3e3d3211a6cb27.js+

from mongodb_logger.

le0pard avatar le0pard commented on July 27, 2024

Strange something in your app. Why sass try to work with files ".css"? This is simple css files, nothing more. To execute rake task be sure, what folder "public/assets" exists in your project.

P.S. Here one of css files:
https://github.com/le0pard/mongodb_logger/blob/master/app/assets/stylesheets/library.css.erb
Just css. Added erb to convert images urls in correct way. Please check your application. In "default" rails 3 app sass only work with files ".sass".

from mongodb_logger.

le0pard avatar le0pard commented on July 27, 2024

Hello, @aja. Do you have any progress about your problem? Because I coudn't reproduce your problems.

from mongodb_logger.

aja avatar aja commented on July 27, 2024

No, you can close the issue though. Maybe it conflicts with a library. I
will notify you if I find the problem.

On Jun 20, 2012, at 11:45 PM, Alexey <
[email protected]>
wrote:

Hello, @aja. Do you have any progress about your problem? Because I coudn't
reproduce your problems.


Reply to this email directly or view it on GitHub:
#36 (comment)

from mongodb_logger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.