Ruby on Rails error “cannot load such file — less”

后端 未结 5 1677
自闭症患者
自闭症患者 2020-12-13 08:53

I am fairly new to ruby on rails, I have been trying to use twitter-bootstrap as an asset, so I have included it in my Gemfile, bundled and it inst

相关标签:
5条回答
  • 2020-12-13 09:28

    I guess you are using sass instead of LESS.

    Have you tried the twitter-bootstrap-rails gem?

    gem "therubyracer"
    gem "less-rails"
    gem "twitter-bootstrap-rails"
    

    https://github.com/seyhunak/twitter-bootstrap-rails

    0 讨论(0)
  • 2020-12-13 09:29

    If you are getting it under Windows this should help you therubyracer_for_windows

    It helped me

    0 讨论(0)
  • 2020-12-13 09:32

    You have to either update therubyracer or downgrade the twitter-bootstrap-rails gem down to version 2.1.7 which is the last known version that didn't have this issue.

    Run either bundle update to update your gems or in your Gemfile make your twitter-bootstrap-rails gem look like this:

    gem 'twitter-bootstrap-rails', '2.1.7'
    

    Take a look at this issue:

    https://github.com/seyhunak/twitter-bootstrap-rails/issues/465

    This issue started happening on versions after 2.1.7 on twitter-bootstrap-rails.

    0 讨论(0)
  • 2020-12-13 09:41

    perhaps you are on windows ... there is no libv8 for windows and no binary therubyracer because it depends on libv8

    0 讨论(0)
  • 2020-12-13 09:44

    I simply needed to restart my server.

    I had added the three gems listed above (less-rails, therubyracer, and twitter-bootstrap-rails, with Rails 3.2.13) while my local server was running, resulting in the problem seen above. So once I shut it down and restarted it again, everything loaded well.

    0 讨论(0)
提交回复
热议问题