Less.js LoadError - there is no such file to load - less on the main .less file

I am trying to check less.js for a new project. I am 100% sure that the javascript file loads fine, but I keep getting this error in a smaller file, which is in my css folder. I am going to compile it using less.app before I run it, but I would prefer less.js to do this during development. Is there a problem with this, preventing the browser from accessing the file, as it doesn't matter or something else? Thanks (works ubuntu 11.04 and ruby ​​v1.9.2, same error in firefox and chrome)

Here is my head.haml file where I link to less.js and app.less (which are in the correct folders)

%link{:rel => "stylesheet/less", :type=>"text/css", :href => "/assets/css/app.less"} %script{:src => "/assets/js/less-1.1.3.min.js", :type => "text/javascript"} 

Here is the error I get in the browser when I open app.less

 LoadError at /assets/css/app.less no such file to load -- less (in /home/blake/biddrr/assets/css/app.less) Ruby /home/blake/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.7/lib/active_support/dependencies.rb: in require, line 239 Web GET localhost/assets/css/app.less 
+6
source share
4 answers

I had the same problem and I did something. The error no such file to load -- file means that Rails cannot find the file in our case less on the system.

This is easy to solve by going to the Gemfile and adding

 group :assets do gem 'less' end 

After that, run a bundle install to get less gem.

Finally reboot the rails s rail server

I am new to RoR and Ruby, so some of the things I have done are useless or have more reasonable solutions. In any case, this solved my problem :) I hope that works for you too!

+22
source

Just put gem 'less' in the assets section of your gemfile. Reboot the server.

+2
source

You may need to set the mime .less type on your web server to make sure that it knows what to do with this file.

0
source

Look at your web server terminal. I use WEBrick and got "ActionView :: Template :: Error (without such a file to download - less") after going through this http://railscasts.com/episodes/328-twitter-bootstrap-basics?view=asciicast screencast. That's all, what i did to install was reset the web server.

0
source

Source: https://habr.com/ru/post/896140/


All Articles