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

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.

Related

Error installing Nokogiri via Bundler on Windows

I'm trying to set up and run the Extreme Startup coding dojo on my Windows machine.
When I reach the bundle install step, I get this error message:
$ bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing builder 3.2.2
Installing nokogiri 1.4.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
c:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150826-3512-ilnke5.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
--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:/Ruby22-x64/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)
extconf failed, exit code 1
Gem files will remain installed in c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/nokogiri-1.4.5 for inspection.
Results logged to c:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/nokogiri-1.4.5/gem_make.out
An error occurred while installing nokogiri (1.4.5), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.4.5'` succeeds before bundling.
According to the documentation for Nokogiri, it just ought to work, and in a sense, it does, because if I issue the command gem install nokogiri, it does work, but installs nokogiri-1.6.6.2-x64-mingw32.
As I understand the error message from bundle install, it specifically wants version 1.4.5. At least, even with nokogiri-1.6.6.2-x64-mingw32 installed, bundle install still fails with the above error message.
This is likely to be a simple problem, but since I'm a novice ruby user, I could use some help.
I've already tried the suggestions from Error installing Nokogiri on bundle install but already installed, but none of them work.
This particular version of Nokogiri is listed in Gemfile.lock. You can remove that file, run bundle install again and see if it works.
This is more a workaround than a proper solution, but dependencies in Gemfile.lock are quite old so it would be a good thing to refresh them anyway.

intalling linecache-0.46 gem(I am using rbenv)

While bundle install the error:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/launchpad/.rbenv/versions/1.9.3-p448/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/launchpad/.rbenv/versions/1.9.3-p448/bin/ruby
Gem files will remain installed in /home/launchpad/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/linecache-0.46 for inspection.
Results logged to /home/launchpad/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/linecache-0.46/ext/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.
You are seeing the error "Can't handle 1.9.x yet" because the linecache gem is not compatible with Ruby 1.9.x. It looks like you are using Ruby 1.9.3-p44.
There is another gem called linecache19 that you can try that is compatible with 1.9.x.
Alternatively, you can:
Use an older version of Ruby via rbenv
Eliminate whatever gem you are trying to use that requires this gem (e.g. ruby-debug)
For more information, look at this question

Cant install rails 4.0 using rubyinstaller. *** extconf.rb failed ***

I am trying to install ruby on rails (v4.0) using ruby installer. It is throwing me this error. I am brand new to RoR and some websites told me to install devkit. I have done that. I ran gem install thin
C:\Users\shashid\Downloads>gem install rails
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
C:/RubyRails/bin/ruby.exe 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
--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:/RubyRails/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:431:in `try_do': The compiler failed to gene
rate an executable file. (RuntimeError)
You have to install development tools first.
from C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:516:in `try_link0'
from C:/RubyRails/lib/ruby/2.0.0/mkmf.rb:814:in `try_run'
from extconf.rb:22:in `<main>'
Gem files will remain installed in C:/RubyRails/lib/ruby/gems/2.0.0/gems/atomic-
1.1.10 for inspection.
Results logged to C:/RubyRails/lib/ruby/gems/2.0.0/gems/atomic-1.1.10/ext/gem_ma
ke.out
Thank you in advance for your help
You need to install Ruby DevKit if on windows, get it from: http://rubyinstaller.org/downloads/ (scroll down a little).
Same story here deleting ruby and installing:
Ruby 2.0.0-p247
DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
from http://rubyinstaller.org/downloads/ solved the problem.
Try to use railsinstaller from http://railsinstaller.org/
it will install follwing
Ruby 1.9.3-p392
Rails 4
Bundler
Git
Sqlite
TinyTDS
SQL Server Support
DevKit
The same can happen when you try to combine 32-bit Ruby and 64-bit DevKit.
The solution is to use same-bit versions.
For instance current versions:
rubyinstaller-2.0.0-p247-x64.exe
DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe

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.

Can't install therubyracer in JRuby

I've installed RVM and then Jruby, this the version that i get when i type: jruby -v:
jruby 1.6.5.1 (ruby-1.8.7-p330) (2011-12-27 1bf37c2) (Java HotSpot(TM) Client VM 1.7.0_02) [linux-i386-java]
The problem is that I can't install therubyracer gem, i get this when i try to install by jruby -S gem install therubyracer:
/usr/local/rvm/rubies/jruby-1.6.5.1/bin/jruby extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very we$
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
Checking for Python...Unable to build libv8: Python not found!
*** 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/rvm/rubies/jruby-1.6.5.1/bin/jruby
I also tried with --1.9 parameter, to force to use another ruby version, but it fails anyway. Even I tried to install libv8, but i get the same error above.
Any ideas?
I have CentOS 5.7
You want the Ruby Rhino.
Just to clarify, in your Gemfile it's:
gem 'therubyrhino'
followed on the command line with:
jruby -S bundle install
I've had the same problem, but defining therubyrhino in the Gemfile didn't solve my problem, bundler kept trying to install libv8.
That happened because I defined twitter-bootstrap-rails gem in the Gemfile, and it depends on the less gem (that depends on therubyracer), so I changed the less gem to use the static branch that not depends on less (as suggested on the issue https://github.com/seyhunak/twitter-bootstrap-rails/issues/22):
gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static"

Resources