Issue while installing therubyracer-heroku - ruby

Issue
I am unable to run middleman server, because dependency therubyracer-heroku is not getting installed!
What I have tried?
I tried installing middleman via the below command:
gem install middleman
And it succeeded. When I started the middleman server using the default configuration:
$ middleman server -p 3456 -e development
I got these errors:
$ middleman server -p 3456 -e development
Could not find libv8-3.11.8.13 in any of the sources
Run `bundle install` to install missing gems.
$ bundle install
src/bootstrapper.cc: In static member function 'static bool v8::internal::Genesis::CompileScriptCached(v8::internal::Vector<const char>, v8::internal::Handle<v8::internal::String>, v8::internal::SourceCodeCache*, v8::Extension*, v8::internal::Handle<v8::internal::Context>, bool)':
src/bootstrapper.cc:1002:18: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
src/bootstrapper.cc: In member function 'bool v8::internal::Genesis::InstallNatives()':
src/bootstrapper.cc:1227:24: error: variable 'name' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
scons: *** [obj/release/bootstrapper.o] Error 1
scons: building terminated because of errors.
make: *** [build/v8/libv8.a] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/praveen/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
extconf.rb:9:in `<main>': Error compiling V8 (RuntimeError)
Gem files will remain installed in /home/praveen/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-heroku-0.8.1.pre3 for inspection.
Results logged to /home/praveen/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-heroku-0.8.1.pre3/ext/v8/gem_make.out
An error occurred while installing therubyracer-heroku (0.8.1.pre3), and Bundler cannot continue.
Make sure that `gem install therubyracer-heroku -v '0.8.1.pre3'` succeeds before bundling.
$
I tried uninstalling libv8 and reinstalling. None worked. Okay, those I tried were:
gem uninstall libv8
gem install therubyracer-heroku
gem install therubyracer-heroku -v '0.8.1.pre3'
gem install therubyracer-heroku-0.8.1.pre3 # psst: I know this is crazy.
gem install therubyracer # succeeded, but this is not what I need.
gem install bundler
gem install bundle
bundle install # crazy things I tried but no luck!
Output of gem install therubyracer-heroku -v '0.8.1.pre3'
src/bootstrapper.cc:1002:18: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
src/bootstrapper.cc: In member function 'bool v8::internal::Genesis::InstallNatives()':
src/bootstrapper.cc:1227:24: error: variable 'name' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
scons: *** [obj/release/bootstrapper.o] Error 1
scons: building terminated because of errors.
make: *** [build/v8/libv8.a] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/praveen/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
extconf.rb:9:in `<main>': Error compiling V8 (RuntimeError)
Gem files will remain installed in /home/praveen/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-heroku-0.8.1.pre3 for inspection.
Results logged to /home/praveen/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-heroku-0.8.1.pre3/ext/v8/gem_make.out
Gemfile contents for your info!
source 'https://rubygems.org'
gem "thin"
gem "rack-contrib"
gem "middleman"
gem "middleman-livereload", :git => "https://github.com/middleman/middleman-livereload.git"
gem "middleman-smusher", :git => "https://github.com/middleman/middleman-smusher.git"
gem "middleman-favicon-maker", :git => "https://github.com/follmann/middleman-favicon-maker.git"
gem "slim"
gem "compass-rgbapng"
gem "sassy-buttons"
group :development do
gem 'heroku'
gem 'foreman'
gem 'therubyracer-heroku', '0.8.1.pre3'
gem 'oj'
end
group :production do
gem 'therubyracer-heroku', '0.8.1.pre3'
gem 'oj'
end
So, any ideas to fix this issue?

Please use the current version of therubyracer (0.11.4 as of this writing), and not therubyracer-heroku. It is no longer needed since the main gem is compatible with heroku and no longer maintained.
The ordinary gem is now compatible with heroku so just
gem "therubyracer"
in your Gemfile should do the trick

Related

extconf.rb:10:in `<main>': uninitialized constant Config (NameError) when `gem install nokogiri -v '1.5.0'`

When I run gem install nokogiri -v '1.5.0', I got the following error.
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /Users/someone/.rvm/gems/ruby-2.6.5/gems/nokogiri-1.5.0/ext/nokogiri
/Users/someone/.rvm/rubies/ruby-2.6.5/bin/ruby -I /Users/someone/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0 -r ./siteconf20200620-16406-16bp1ha.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/someone/.rvm/rubies/ruby-2.6.5/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)
Did you mean? RbConfig
CONFIG
extconf failed, exit code 1
Gem files will remain installed in /Users/someone/.rvm/gems/ruby-2.6.5/gems/nokogiri-1.5.0 for inspection.
Results logged to /Users/someone/.rvm/gems/ruby-2.6.5/extensions/x86_64-darwin-18/2.6.0/nokogiri-1.5.0/gem_make.out
It looks like I have to modify the extconf.rb file. But where do I find that file?
Try installing newer version:
gem install nokogiri -v 1.6.8

unable to locate libxml2 when installing gem

Problem with install of twilio-ruby. I have installed libxml2 using homebrew and confirmed it is there. However when I try running
gem install twilio-ruby
I recieve an error that it cannot find libxml2. I have tried specifying the path to libxml2 but still can't get it to install. Any suggestions?
I have tried the following
gem install twilio-ruby -- --with-xml2-dir=/usr/local/Cellar/libxml2
gem install twilio-ruby -- --use-system-libraries
Then all of these three together:
gem install twilio-ruby -- --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.1 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include
Each time I get output similar to the below.
gem install twilio-ruby -- --with-xml2-dir=/usr/local/Cellar/libxml2
Building native extensions with: '--with-xml2-dir=/usr/local/Cellar/libxml2'
This could take a while...
ERROR: Error installing twilio-ruby:
ERROR: Failed to build gem native extension.
/Users/tom/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb --with-xml2-dir=/usr/local/Cellar/libxml2
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/tom/.rvm/rubies/ruby-2.1.1/bin/ruby
--with-xml2-config
--without-xml2-config
--with-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
extconf failure: need libxml2.
Install the library or try one of the following options to extconf.rb:
--with-xml2-config=/path/to/xml2-config
--with-xml2-dir=/path/to/libxml2
--with-xml2-lib=/path/to/libxml2/lib
--with-xml2-include=/path/to/libxml2/include
extconf failed, exit code 1
Gem files will remain installed in /Users/tom/.rvm/gems/ruby-2.1.1#carecoach/gems/libxml-ruby-3.0.0 for inspection.
Results logged to /Users/tom/.rvm/gems/ruby-2.1.1#carecoach/extensions/x86_64-darwin-12/2.1.0-static/libxml-ruby-3.0.0/gem_make.out
'
So after much pain and frustration, and trying a bunch of stuff the solution was the following:
gem update --system
xcode-select --install # Then agree to the terms, even if you have done this before!

"Invalid argument # dir_s_mkdir" - rbczmq gem installation error on windows

I am on windows7 with Ruby2.1.5.
While installing rbczmq i got below error:
C:\Users\namitk>gem install rbczmq
Building native extensions. This could take a while...
ERROR: Error installing rbczmq:
ERROR: Failed to build gem native extension.
C:/Ruby21-x64/bin/ruby.exe extconf.rb
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby21-x64/bin/ruby
--with-kernel32lib
--without-kernel32lib
--with-rpcrt4lib
--without-rpcrt4lib
--with-gdi32lib
--without-gdi32lib
extconf.rb:49:in `<main>': uninitialized constant GNU_CHAIN (NameError)
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rbczmq-1.7.8 for inspection.
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/rbczmq-1.7.8/gem_make.out
even gem install rbczmq -- --with-system-libs is also giving error. So above two error cases came i tried to install rbczmq using gem hosting service
Then i have downloaded source from its git repo: https://github.com/methodmissing/rbczmq
then i did:
git submodule init
git submodule update
and from that source when i tried to build the gem from its gemspec file as gem build rbczmq.gemspec; same uninitialized constant GNU_CHAIN error came.
then and i build the gem using system libs as below, and it was successful:
D:\rbczmq>gem build rbczmq.gemspec -- --with-system-libs
WARNING: description and summary are identical
WARNING: pessimistic dependency on minitest (~> 5.5.0, development) may be overly strict
if minitest is semantically versioned, use:
add_development_dependency 'minitest', '~> 5.5', '>= 5.5.0'
WARNING: pessimistic dependency on rake-compiler (~> 0.8.0, development) may be overly strict
if rake-compiler is semantically versioned, use:
add_development_dependency 'rake-compiler', '~> 0.8', '>= 0.8.0'
WARNING: See http://guides.rubygems.org/specification-reference/ for help
Successfully built RubyGem
Name: rbczmq
Version: 1.7.8
File: rbczmq-1.7.8.gem
as you can see above step is successful when i build gem from source on windows. But error comes when i install this gem as:
D:\rbczmq>gem install rbczmq-1.7.8.gem
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument # dir_s_mkdir - C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/rbczmq-1.7.8/d:
so is there any mistake while building the gem from source? how to solve Invalid argument # dir_s_mkdir error as mentioned above on windows?
FYI: i got zeromq win64 builds for matching zeromq used in given rbczmq from https://binstar.org/minrk/zeromq/4.0.3/download/win-64%5Czeromq-4.0.3-1.tar.bz2

Can't handle 1.9.x error when trying to install linecache with Ruby 2.1.1

I am trying to install linecache with RVM on Ruby 2.1.1.
$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
I run bundle install
$ bundle install
It blows saying it isn't compatible with 1.9.x when I run bundle install:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/g/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries
and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/g/.rvm/rubies/ruby-2.1.2/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in /home/g/.rvm/gems/ruby-2.1.2/gems/linecache-0.46
for inspection.
Results logged to /home/g/.rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0
/linecache-0.46/gem_make.out
An error occurred while installing linecache (0.46), and Bundler cannot continue.
Make sure that `gem install linecache -v '0.46'` succeeds before bundling.
Any ideas whats happening here?
Linecache hasn't been updated in 3 years, the last update was bringing it up to version 1.9.3. Unless you're pulling it from someone else's fork, since you're using 2.1.1 the gem won't work. Most likely the error message hasn't been updated so it just tells you it's invalid for 1.9.x since it doesn't know about any newer versions.

Error installing debugger-linecache: ERROR: Failed to build gem native extension

I am trying to bundle install but it is showing the above error or debugger..Please find the detailed error from the terminal
Installing debugger-linecache (1.1.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/ruby/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.2-p0 provided with debugger-ruby_core_source gem.
**************************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/ruby/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
Gem files will remain installed in /usr/local/ruby/lib/ruby/gems/1.9.1/gems/debugger-linecache-1.1.1 for inspection.
Results logged to /usr/local/ruby/lib/ruby/gems/1.9.1/gems/debugger-linecache-1.1.1/ext/trace_nums/gem_make.out
An error occured while installing debugger-linecache (1.1.1), and Bundler cannot continue.
Make sure that `gem install debugger-linecache -v '1.1.1'` succeeds before bundling.
If i type ruby-v in the terminal I get
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
If I do gem install debugger-linecache I still get the same error.
How this can be solved. Please help??
I had a very similar error, but on ruby 1.9.3. Running:
gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/
Got it working for me. Credit to this answer.
I solved similiar problem (upgrading Ruby 1.9.3 to 2.0) with simple
bundle update debugger
which as a result installed gem version 1.6.0
Same fix, a bit more up to date
# check ruby version with rvm info
gem install debugger-linecache -v '1.1.2' \
-- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p448
On Ubuntu 13.04 if that matters.
I had to:
gem install debugger-ruby_core_source -v 1.1.2
then:
gem install debugger
Then my bundle completed fine.
Thanks to this comment on the issue.

Resources