1

I'm a complete noob in ruby, so please pardon my mistakes.

I'm installing Apphera (a social networking crawler) on Ubuntu 14.04, and I'm getting this error when I'm trying to start the ruby server

ankit@APPSERVER:/home/deployer/apphera$ rails s
/usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:61:in `rescue in lock': uninitialized constant V8::JSError (NameError)
    from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:60:in `lock'
    from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:19:in `initialize'
    from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `new'
    from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/java_script/v8_context.rb:15:in `instance'
    from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less/loader.rb:10:in `initialize'
    from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:14:in `new'
    from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:14:in `<module:Less>'
    from /usr/lib/ruby/gems/1.9.1/gems/less-2.2.1/lib/less.rb:9:in `<top (required)>'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `require'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:72:in `block in require'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:61:in `each'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler/runtime.rb:61:in `require'
    from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.7.9/lib/bundler.rb:134:in `require'
    from /home/deployer/apphera/config/application.rb:16:in `<top (required)>'
    from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:53:in `require'
    from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:50:in `tap'
    from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.7/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

I understand that this issue that got something to do with the JS environment on the system and I tried installing nodes, but the error was same. I tried almost every solution mentioned on SO, but nothing worked for me.

Here are some specific details about my installation:

  • Ruby : 1.9.1
  • gem - v : 2.4.5
  • gem list | grep libv8 --> libv8 3.16.14.7
  • gem list | grep therubyracer --> therubyracer 0.12.1

I tried installing therubyracer/libv8 both manually and with with bundle install, but it didn't work. I even made changes to my gemfile/Gemfile.lock, but,again, nothing worked.

ankit garg
  • 358
  • 4
  • 9
  • Are you sure about that Ruby version? 1.9.1? What does typing `ruby -v` print out? My suggestion would be to `gem uninstall libv8` then `gem install libv8`, and do the same for therubyracer. Sounds like a build error to me. – Peter Goldstein Dec 23 '14 at 17:37
  • Thanks for the response. Although I am sure about the Ruby version, but I'll double check it. Currently I am out of my office network and can't access the server. Anyways, I did exactly what you mentioned, but the error didn't get fixed. I tried installing via bundle too and the installation was successful, but the error was still there. – ankit garg Dec 23 '14 at 17:43
  • If you're sure about the Ruby version then you need to do something about that. At this point the oldest version of Ruby that should be used is 1.9.3, and even that's a stretch. A 2.0.0pX or 2.1.x is advisable for production systems. – Peter Goldstein Dec 23 '14 at 17:49
  • Peter, it's a big favour to ask for, but could you please go through this readme file. I am getting error at 'rails s' --- https://github.com/boy-jer/apphera/blob/master/README.md – ankit garg Dec 23 '14 at 17:50
  • Thanks. I'll update the version of Ruby and see if it fixes the error. – ankit garg Dec 23 '14 at 17:51
  • The Apphera project only has 12 commits and hasn't had any updates in over 2 years. The odds of it working correctly are extremely low. – Peter Goldstein Dec 23 '14 at 18:22
  • Since the Gemfile in that project has Rails3. With Ruby 1.9.1 you cannot run Rails3 look here -> http://guides.rubyonrails.org/3_0_release_notes.html#rails-3-requires-at-least-ruby-1-8-7 – uday Dec 23 '14 at 22:10

0 Answers0