Search code examples
rubyhanami

Get error when loading assets in Lotusrb


I am trying out Lotusrb framework and I am having problems with assets. I followed the instructions for using in lotus from lotus-assets in github but I get the error Errno::ENOENT: No such file or directory @ realpath_rec.

The error happens when I do:

Lotus::Assets.configure do
  compile true

  define :stylesheet do
    sources << [
      'app/web/assets/stylesheets' # this is the path to my stylesheets
   ]
  end
end

And then in my template:

<%= stylesheet 'application' %>

Don't know what I am doing wrong. Any help?


Solution

  • If you generated your app from lotus new then I think you have a typo. Lotus generates an apps directory. Try this:

    Lotus::Assets.configure do
      compile true
    
      define :stylesheet do
        sources << [
          'apps/web/assets/stylesheets' # you had 'app/web/assets/stylesheets'
       ]
      end
    end