Using less (2.2.1) raises an error requiring therubyracer (can't install therubyracer on windows)
Asked Answered
B

1

9

I've been working to get twitter-bootstrap-rails gem working on my windows machine and ran into an error attempting to install 'therubyracer' gem which is a dependency of older version of the less gem.

I think upgraded to less 2.2.1 which is not dependent on therubyracer however in spite of that it seems to think I still need therubyracer installed. Here is the output of the error I get when I try to start my rails server 'rails s'.

$ rails s
[WARNING] Please install gem 'therubyracer' to use Less.
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- v8 (LoadError)
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-2.2.2/lib/less/java_script/v8_context.rb:2:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-2.2.2/lib/less/java_script.rb:9:in `default_context_wrapper'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-2.2.2/lib/less/java_script.rb:17:in `context_wrapper'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-2.2.2/lib/less/loader.rb:10:in `initialize'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-2.2.2/lib/less.rb:14:in `new'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-2.2.2/lib/less.rb:14:in `<module:Less>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-2.2.2/lib/less.rb:9:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-rails-2.2.3/lib/less/rails.rb:6:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/less-rails-2.2.3/lib/less-rails.rb:1:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/twitter-bootstrap-rails-2.1.2/lib/twitter-bootstrap-rails.rb:9:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `each'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `block in require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `each'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler.rb:122:in `require'
    from C:/Sites/alliance/config/application.rb:9:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
    from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Here are my Gemfile and Gemfile.lock files. Can anyone help me figure out how to tell my app that it doesn't need 'therubyracer' installed?

---- Gemfile ----

source 'https://rubygems.org'

gem 'rails',   '~> 3.2.3'
gem 'jquery-rails'
gem 'haml-rails'
gem 'simple_form'
gem 'decent_exposure'
gem "devise", :git => "git://github.com/plataformatec/devise.git"
gem 'cancan'
gem 'prawn'
gem 'ransack'
gem 'eventmachine', '= 1.0.0.rc.4'
gem 'therubyracer', :platforms => :ruby

group :assets do
  gem 'execjs'
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'bootstrap-sass'
  gem 'twitter-bootstrap-rails' 
  gem 'uglifier', '>= 1.0.3'
end

group :development, :test do
  gem 'debugger'
  gem 'rails_best_practices'
  gem 'factory_girl_rails', '~> 2.0'
  gem 'sqlite3'
  gem 'simplecov', require: false
  gem 'rspec-rails'
  gem 'rspec-instafail'
  gem 'rspec-steps'
  gem 'factory_girl_rails', '~> 2.0'
  gem "capybara"
  gem "selenium-webdriver"
  gem 'launchy' # provides save_and_open_page
  gem 'fuubar'

  gem 'database_cleaner'
  gem 'rantly'
  gem 'heroku'
  gem 'rb-fsevent' #, :require => false if RUBY_PLATFORM =~ /darwin/i
  gem 'guard-rspec'
end

group :production do
  gem 'mysql2'
  gem 'thin'
  gem 'pg'
end

---- Gemfile.lock ----

GIT
  remote: git://github.com/plataformatec/devise.git
  revision: f7dd59839cd39ed3c57948d37e8a95c697c14647
  specs:
    devise (2.1.2)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.1)
      railties (~> 3.1)
      warden (~> 1.2.1)

GEM
  remote: https://rubygems.org/
  specs:
    Ascii85 (1.0.1)
    actionmailer (3.2.8)
      actionpack (= 3.2.8)
      mail (~> 2.4.4)
    actionpack (3.2.8)
      activemodel (= 3.2.8)
      activesupport (= 3.2.8)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.0)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.1.3)
    activemodel (3.2.8)
      activesupport (= 3.2.8)
      builder (~> 3.0.0)
    activerecord (3.2.8)
      activemodel (= 3.2.8)
      activesupport (= 3.2.8)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.8)
      activemodel (= 3.2.8)
      activesupport (= 3.2.8)
    activesupport (3.2.8)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    addressable (2.3.2)
    arel (3.0.2)
    awesome_print (1.0.2)
    bcrypt-ruby (3.0.1-x86-mingw32)
    bootstrap-sass (2.1.0.0)
    builder (3.0.1)
    cancan (1.6.8)
    capybara (1.1.2)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      selenium-webdriver (~> 2.0)
      xpath (~> 0.1.4)
    childprocess (0.3.5)
      ffi (~> 1.0, >= 1.0.6)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.3.3)
    colored (1.2)
    columnize (0.3.6)
    commonjs (0.2.6)
    daemons (1.1.9)
    database_cleaner (0.8.0)
    debugger (1.2.0)
      columnize (>= 0.3.1)
      debugger-linecache (~> 1.1.1)
      debugger-ruby_core_source (~> 1.1.3)
    debugger-linecache (1.1.2)
      debugger-ruby_core_source (>= 1.1.1)
    debugger-ruby_core_source (1.1.3)
    decent_exposure (1.0.2)
    diff-lcs (1.1.3)
    erubis (2.7.0)
    eventmachine (1.0.0.rc.4-x86-mingw32)
    excon (0.16.2)
    execjs (1.4.0)
      multi_json (~> 1.0)
    factory_girl (3.0.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (2.0.0)
      factory_girl (~> 3.0.0)
      railties (>= 3.0.0)
    ffi (1.1.5)
    fuubar (1.0.0)
      rspec (~> 2.0)
      rspec-instafail (~> 0.2.0)
      ruby-progressbar (~> 0.0.10)
    guard (1.3.2)
      listen (>= 0.4.2)
      thor (>= 0.14.6)
    guard-rspec (1.2.1)
      guard (>= 1.1)
    haml (3.1.7)
    haml-rails (0.3.4)
      actionpack (~> 3.0)
      activesupport (~> 3.0)
      haml (~> 3.0)
      railties (~> 3.0)
    hashery (2.0.1)
    heroku (2.31.2)
      heroku-api (~> 0.3.4)
      launchy (>= 0.3.2)
      netrc (~> 0.7.7)
      rest-client (~> 1.6.1)
      rubyzip
    heroku-api (0.3.4)
      excon (~> 0.16.1)
    hike (1.2.1)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (2.1.2)
      railties (>= 3.1.0, < 5.0)
      thor (~> 0.14)
    json (1.7.5)
    launchy (2.1.2)
      addressable (~> 2.3)
    less (2.2.2)
      commonjs (~> 0.2.6)
    less-rails (2.2.3)
      actionpack (>= 3.1)
      less (~> 2.2.0)
    libwebsocket (0.1.5)
      addressable
    listen (0.5.0)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.19)
    multi_json (1.3.6)
    mysql2 (0.3.11-x86-mingw32)
    netrc (0.7.7)
    nokogiri (1.5.5-x86-mingw32)
    orm_adapter (0.4.0)
    pdf-reader (1.2.0)
      Ascii85 (~> 1.0.0)
      hashery (~> 2.0)
      ruby-rc4
    pg (0.14.1-x86-mingw32)
    polyamorous (0.5.0)
      activerecord (~> 3.0)
    polyglot (0.3.3)
    prawn (0.12.0)
      pdf-reader (>= 0.9.0)
      ttfunk (~> 1.0.2)
    progressbar (0.11.0)
    rack (1.4.1)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.1)
      rack (>= 1.0)
    rails (3.2.8)
      actionmailer (= 3.2.8)
      actionpack (= 3.2.8)
      activerecord (= 3.2.8)
      activeresource (= 3.2.8)
      activesupport (= 3.2.8)
      bundler (~> 1.0)
      railties (= 3.2.8)
    rails_best_practices (1.10.1)
      activesupport
      awesome_print
      colored
      erubis
      i18n
      progressbar
      sexp_processor
    railties (3.2.8)
      actionpack (= 3.2.8)
      activesupport (= 3.2.8)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (0.9.2.2)
    ransack (0.7.0)
      actionpack (~> 3.0)
      activerecord (~> 3.0)
      polyamorous (~> 0.5.0)
    rantly (0.3.1)
    rb-fsevent (0.9.1)
    rdoc (3.12)
      json (~> 1.4)
    rest-client (1.6.7)
      mime-types (>= 1.16)
    rspec (2.11.0)
      rspec-core (~> 2.11.0)
      rspec-expectations (~> 2.11.0)
      rspec-mocks (~> 2.11.0)
    rspec-core (2.11.1)
    rspec-expectations (2.11.3)
      diff-lcs (~> 1.1.3)
    rspec-instafail (0.2.4)
    rspec-mocks (2.11.2)
    rspec-rails (2.11.0)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec (~> 2.11.0)
    rspec-steps (0.0.8)
      rspec (>= 2.6)
    ruby-progressbar (0.0.10)
    ruby-rc4 (0.1.5)
    rubyzip (0.9.9)
    sass (3.2.1)
    sass-rails (3.2.5)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    selenium-webdriver (2.25.0)
      childprocess (>= 0.2.5)
      libwebsocket (~> 0.1.3)
      multi_json (~> 1.0)
      rubyzip
    sexp_processor (4.0.1)
    simple_form (2.0.2)
      actionpack (~> 3.0)
      activemodel (~> 3.0)
    simplecov (0.6.4)
      multi_json (~> 1.0)
      simplecov-html (~> 0.5.3)
    simplecov-html (0.5.3)
    sprockets (2.1.3)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.6-x86-mingw32)
    thin (1.4.1)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.16.0)
    tilt (1.3.3)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    ttfunk (1.0.3)
    twitter-bootstrap-rails (2.1.2)
      actionpack (>= 3.1)
      less-rails (~> 2.2.3)
      railties (>= 3.1)
    tzinfo (0.3.33)
    uglifier (1.3.0)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    warden (1.2.1)
      rack (>= 1.0)
    xpath (0.1.4)
      nokogiri (~> 1.3)

PLATFORMS
  x86-mingw32

DEPENDENCIES
  bootstrap-sass
  cancan
  capybara
  coffee-rails (~> 3.2.1)
  database_cleaner
  debugger
  decent_exposure
  devise!
  eventmachine (= 1.0.0.rc.4)
  execjs
  factory_girl_rails (~> 2.0)
  fuubar
  guard-rspec
  haml-rails
  heroku
  jquery-rails
  launchy
  mysql2
  pg
  prawn
  rails (~> 3.2.3)
  rails_best_practices
  ransack
  rantly
  rb-fsevent
  rspec-instafail
  rspec-rails
  rspec-steps
  sass-rails (~> 3.2.3)
  selenium-webdriver
  simple_form
  simplecov
  sqlite3
  therubyracer
  thin
  twitter-bootstrap-rails
  uglifier (>= 1.0.3)
Blas answered 7/9, 2012 at 3:26 Comment(0)
P
-1

I'd highly recommend you follow Daniel Kehoe's excellent: https://github.com/RailsApps/rails3-bootstrap-devise-cancan if you aren't already.

About the only suspicious thing I can see in your Gemfile is that is has 'rubyracer' in it. Why is that there? Try removing it. Don't forget to bundle install whenever you make any changes, of course.

Pestilential answered 7/9, 2012 at 4:49 Comment(5)
Thanks for the suggestion. The issue is that this is an already existing application that I have built and successfully hosted on heroku. However now I am trying to get some friends up and running with it on their local windows machines and i'm running into this issues. I originally developed the app on a mac so I didn't have this problem. Ideally I'd like to not have to change the app for them to work on it but to figure out how to get the dependancies to install. Thanks!Blas
gem 'therubyracer', :platforms => :ruby doesn't install therubyracer on windows. The bundle completes just fine. Like I said it just bombs out 'thinking' it needs therubyracer when it doesn't.Blas
Have you looked at these threads, they may be relevant to your situation: #8421821 https://mcmap.net/q/129976/-therubyracer-gem-on-windows and (one more) github.com/cowboyd/therubyracer/issues/126Pestilential
I have looked at these, and quite all the other threads on 'therubyracer' and dealing with these gem dependancies on windows. I have also looked through the open issues on github and the open pull request (as of last friday) that steriobooster has to get 'therubyracer' installing on windows However, I have modifies my dependancies such that I actually DO NOT need therubyracer to be installed. Less just 'thinks' that it needs it to be installed (successful bundle, but bombs out when you rails rails s). So my question is, how do I get less to realize it doesn't need therubyracer??Blas
I've been digging at this for a while and I've come to the conclusion to just use commonjs to bundle my interface along with less.js and compile less on the client side. The asset pipeline is nice but there isn't a clean way around therubyracer to compile less with ruby, and the UI is better served with only requiring what I need on the page.Libertine

© 2022 - 2024 — McMap. All rights reserved.