Can't install ruby-debug? - ruby

Has anyone else encountered this?
gem install ruby-debug
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.
/Users/ohad/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** extconf.rb failed ***
I am using a gemset if that has anything to do with it.

The debugger gem is the de facto standard for the current version of Ruby.

The only debugger that works for me so far is the debugger gem found at https://github.com/cldwalker/debugger
Put the gem 'debugger' in Gemfile or install it just for development.
group :development do
gem 'debugger'
end
I have tried a couple of other options (which all failed) before landing on debugger gem. Specifically, ruby-debug and ruby-debug19 (https://github.com/denofevil/ruby-debug19).
ruby-debug failed to install. While ruby-debug19 did install, I got an error on require 'ruby-debug' ; Debugger.start.
Here is my environment:
ruby 1.9.3p374 (2013-01-15 revision 38858) [i686-linux]
Rails 3.2.11
Ubuntu 12.04.2 LTS 32bit

You need to use the ruby-debug19 version as the 'regular' version is incompatible with Ruby 1.9:
gem install ruby-debug19
For more information check the gems project page.

Related

Missing gem Faraday

I'm new to Ruby and I'm just trying to run a script. Firstly, when I try to bundle install it says:
Daniels-Air:Documents Daniel$ bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Rubygems 2.0.3 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Installing ffi 1.9.10 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /var/folders/_r/8pxmrph95fj0km8h7sfkw9f40000gn/T/bundler20151216-21689-8jiqebffi-1.9.10/gems/ffi-1.9.10 for inspection.
Results logged to /var/folders/_r/8pxmrph95fj0km8h7sfkw9f40000gn/T/bundler20151216-21689-8jiqebffi-1.9.10/gems/ffi-1.9.10/ext/ffi_c/gem_make.out
Using multipart-post 2.0.0
Installing json 1.8.3 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /var/folders/_r/8pxmrph95fj0km8h7sfkw9f40000gn/T/bundler20151216-21689-5mz4k9json-1.8.3/gems/json-1.8.3 for inspection.
Results logged to /var/folders/_r/8pxmrph95fj0km8h7sfkw9f40000gn/T/bundler20151216-21689-5mz4k9json-1.8.3/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
Using multi_json 1.11.2
Using rubyzip 1.1.7
Using websocket 1.2.2
Using bundler 1.11.1
An error occurred while installing ffi (1.9.10), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.10'` succeeds before bundling.
When I then try to execute the file anyway I come across the problem:
Could not find gem 'faraday' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
Where do I get this 'faraday' gem from? Should it have come with the code I am trying to run, or should I update something? Sorry if I got some terminology wrong, I'm very new to Ruby.
I've just realised all I needed to do was install the gem. Its made clear from the RubyGems.org library. Just typed:
sudo gem install faraday
to the terminal

Unable to Install Shoes :ruby

I am beginner in ruby and wanted to install and GUI toolkit. So i surfed web and found shoes was one toolkit so i downloaded the ".install" file it didn't work saying some permission error, then i downloaded the older version which was ".run" format and that too didn't work so i found a gem of shoes when i try to download i get the below in ruby. i downloaded this shoes from git and still facing some error.
root#Drona:/home/naren/shoes4# gem install bundler && bundle install
Successfully installed bundler-1.10.5
1 gem installed
Installing ri documentation for bundler-1.10.5...
Installing RDoc documentation for bundler-1.10.5...
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all
non-root users on this machine.
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Using rake 10.4.2
Using addressable 2.3.8
Using after_do 0.3.1
Using ast 2.0.0
Using parser 2.2.2.6
Using astrolabe 1.3.0
Using benchmark-ips 2.2.0
Using bouncy-castle-java 1.5.0147
Using docile 1.1.5
Installing json 1.8.3 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.8.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
the above is the terminal output.
Ruby version installed is :
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
someone help we out with this installation
and if i have done anything wrong in installation of shoes then let me know
From your terminal directory it seems like you are trying to install shoes4 on ruby 1.9.3. To install shoes4 you need JRuby and a JDK - please follow the instructions in the readme
Shoes 3 can't be installed through gem install due to the way it was built. For Shoes 3 you need the install script, I recommend the appropriate Shoes 3.2 version from this page. If this fails with some error please let us know the error so we can help :)
You should use the gem program to install shoes. If on your command line you type gem install shoes you should be fine.
to use it in an app, you would need to create a Gemfile and run Bundle install within your folder

Can't install prebuilt gem

I'm trying to install prebuilt binary of pg gem on windows (I don't want devkit):
>ruby -v
ruby 2.1.4p265 (2014-10-27 revision 48166) [x64-mingw32]
>gem install pg
Fetching: pg-0.17.1.gem (100%)
ERROR: Error installing pg:
The 'pg' native gem requires installed build tools.
>gem install pg -v 0.17.1 --platform=x64-mingw32
ERROR: Error installing pg:
The 'pg' native gem requires installed build tools.
even though the binary gem is published at https://rubygems.org/gems/pg/versions/0.17.1-x64-mingw32
What am I doing wrong ?
Same thing happens with 32-bit ruby.
So it turns out the gem was prebuilt for ruby 2.0.x which is not ABI compatible with ruby 2.1.x that I'm using. The error message could be more clear about that :(
Switched to the latest pre-release that contains needed binary and everything is fine now.

Problems installing gems with RubyGems

I'm using Debian 5
Ruby version 1.8.7
Rubygems version 2.0.3
Rails version 3.2.12
I made my Ruby on Rails app and want to deploy it publicly, so I tried to install "Mongrel" without any luck and then "Unicorn" also without any luck and same error.
vps1198019:~# gem install mongrel
Building native extensions. This could take a while...
ERROR: Error installing mongrel:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/ext/http11/gem_make.out
and
vps1198019:~# gem install unicorn
Building native extensions. This could take a while...
ERROR: Error installing unicorn:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/kgio-2.8.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/kgio-2.8.0/ext/kgio/gem_make.out
Try using below command. Because of version mismatch, gem is not installed.
$ gem install mongrel --pre
So I found a solution for my problem by installed it more manually. I downloaded Unicorn from http://rubyforge.org/frs/?group_id=1306 (.gem file). Stored it in server. Went to that folder with terminal. Then I accessed it with
gem install --local unicorn.gem
Then it prompted that I must have kgio and raindrops so I installed them:
gem install kgio
gem install raindrops
and repeated first command.

RVM + Ruby 1.9.1 + ruby-debug = error?

I am trying to get a decent navigation between my methods in TextMate. I would love to have a list of them in a drawer, but I guess there is no such solution yet, right? Therefore I am trying to set up RubyAMP to work with Ruby 1.9.1-p378 installed via RVM, but have some troubles. RubyAMP needs ruby-debug, and here is what I get if I try to install the gem
$ rvm gem install ruby-debug
info: ruby-1.9.1-p378: ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-darwin10]
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.
/Users/andrei/.rvm/rubies/ruby-1.9.1-p378/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** extconf.rb failed ***
However, the gem page says that it should work with 1.9.x. How can I fix it?
Try this(from https://rvm.io/support/troubleshooting):
rvm gem install ruby-debug19 -- --with-ruby-include="$rvm_src_path/ruby-1.9.1-p378/"
The latest ruby 1.9.2-p0 runs gem install ruby-debug19 without a hitch.
For the latest ruby 1.9.2-preview3
gem install ruby-debug19 -- --with-ruby-include="$rvm_src_path/ruby-1.9.2-preview3"

Resources