NetBeans 6.9.1 and the ruby FastDebugger - ruby

I need to use ruby 1.8.6 to run a legacy script. I've installed NetBeans 6.9.1 and I'm trying to use the fast debugger but when I try to install it I get:
/home/eianni/.rvm/gems/ruby-1.8.6-p420#xml2rpc/gems/rubygems-bundler-0.3.0/lib/rubygems_bundler/regenerate_binstubs_command.rb:34: warning: parenthesize argument(s) for future version
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug-ide:
ERROR: Failed to build gem native extension.
/home/eianni/.rvm/rubies/ruby-1.8.6-p420/bin/ruby mkrf_conf.rb
/home/eianni/.rvm/gems/ruby-1.8.6-p420#xml2rpc/gems/rubygems-bundler-0.3.0/lib/rubygems_bundler/regenerate_binstubs_command.rb:34: warning: parenthesize argument(s) for future version
Gem files will remain installed in /home/eianni/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9 for inspection.
Results logged to /home/eianni/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/ext/gem_make.out
This is probably because the ruby version is too old, but is there a way to tell Netbeans to use a different version for ruby-debug-ide. I can install withouth problems ruby-debug-ide 0.10.0.
I'm using Ubuntu 10.04

In order to use ruby-debug-ide 0.4.9 with Ruby 1.8.6, you have to install ruby-debug-base 0.10.3 and linecache 0.45.
To know and manage your gems in Netbeans :
Tools -> Ruby Gems -> Installed

Related

Can't install Ruby Compass on Mac Big Sur 11.5.2

I'm trying to get Compass installed on a 2020 Mac Book Pro running Big Sur (11.5.2).
When I try and run:
gem install compass
I get the error:
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory
If I try and run:
sudo gem install compass
I get the error:
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/ext/ffi_c
I've tried installing and updating Ruby.
I've tried updating the system Ruby, but the system doesn't allow a more recent version than the below:
Updating rubygems-update
Fetching rubygems-update-3.3.3.gem
Successfully installed rubygems-update-3.3.3
Parsing documentation for rubygems-update-3.3.3
Installing ri documentation for rubygems-update-3.3.3
Installing darkfish documentation for rubygems-update-3.3.3
Done installing documentation for rubygems-update after 206 seconds
Parsing documentation for rubygems-update-3.3.3
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.3.3
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted # rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/gem
% ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
Not sure what to do or try next.
Anyone have any ideas on how to get Compass installed?
This really decomposes to two issues, as you noticed with the sudo call.
(1) You're trying to write gems to the protected directory for your system Ruby.
In most development environments, it's best to install a Ruby version manager that allows you to install multiple Rubies side-by-side for different projects. Purely subjectively, I'd recommend rbenv to manage only Ruby, or asdf to manage Ruby versions along with other languages versions. However, the question of which Ruby version manager to use is very well tread already, so you can pick the solution that's best for your needs with existing information.
(2) You're installing a gem with native extensions, which means that you need the underlying C libraries installed on your system to build correctly (assuming you're using CRuby, the default Ruby implementation). You'll need to install libffi-dev on your machine to build that gem correctly. Based on this question, it seems a simple brew install libffi should work for that.
Lastly, I'll suggest that it's idiomatic to use the bundler gem to manage gems per-project with Ruby. I'd reconsider if you really want to run this gem system-wide, or if it might vary versions across multiple projects.

Yosemite - SQLite3 gem installation error - C extensions not supported

I want to use SQLite3 in a jruby project.
gem install SQLite3
command fails with
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/Users/h1k3n/.rvm/rubies/jruby-9.0.0.0/bin/jruby -r ./siteconf20150809-4559-7o84f5.rb extconf.rb
NotImplementedError: C extensions are not supported
<top> at /Users/h1k3n/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/mkmf.rb:1
require at org/jruby/RubyKernel.java:940
(root) at /Users/h1k3n/.rvm/rubies/jruby-9.0.0.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
<top> at extconf.rb:3
extconf failed, exit code 1
Gem files will remain installed in /Users/h1k3n/.rvm/gems/jruby-9.0.0.0/gems/sqlite3-1.3.10 for inspection.
Results logged to /Users/h1k3n/.rvm/gems/jruby-9.0.0.0/extensions/universal-java-1.8/2.2.0/sqlite3-1.3.10/gem_make.out
gcc version
which gcc => /usr/bin/gcc
trying to install SQLite3
brew instal SQLite3 => Warning: sqlite-3.8.11 already installed
SQLite3 version installed
which SQLite3 => ~/Android/sdk/platform-tools/sqlite3
i thinks this is the culprit. It probably points to the Android version of SQLite3 instead of a system one and that's why it fails to build the native extension.
You appear to be using JRuby, not the standard Ruby implementation, Ruby MRI.
The SQLite3 gem relies on Ruby C extensions, but unlike the standard implementation, JRuby does not support Ruby C extensions:
JRuby versions prior to 1.6 did not support Ruby C extensions, and even in 1.6 the support is still "in development" and considered experimental. As of 1.7, it has been disabled and will likely be removed.
The article above lists recommendations to alternative gems, including for SQLite3.

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.

Ruby and gem version compatibility

I had an SSH-session to some Ubuntu Server. The latest available Ruby package with -full was an apt-get install ruby1.9.1-full. But after apt-get install rubygems1.9.1 the problem was that:
root#...:~# gem install nokogiri
ERROR: Error installing nokogiri:
nokogiri requires Ruby version >= 1.9.2
And I didn't know, which version of Nokogiri I had to install. I tried to guess:
root#...:~# gem install nokogiri -v 1.5.10
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
..........bla..bla..bla...
and had to switch to RVM way (there I had 1.9.3 and no further problems with gems I needed).
But anyway I prefer non-RVM way, so the question is: How do I know, which version of the gem is compatible with my Ruby?
Inspecting from the CHANGLOG.rdoc of Nokogiri in its source:
1.6.0.rc1 / 2013-04-14
This release was based on v1.5.9, and so does not contain any fixes mentioned in the notes for v1.5.10.
Notes
mini_portile is now a runtime dependency
Ruby 1.9.2 and higher now required
Features
(MRI) Source code for libxml 2.8.0 and libxslt 1.2.26 is packaged with the gem. These libraries are compiled at gem install time unless the environment variable NOKOGIRI_USE_SYSTEM_LIBRARIES is set. VERSION_INFO (also `nokogiri -v`) exposes whether libxml was compiled from packaged source, or the system library was used.
(Windows) libxml upgraded to 2.8.0
Deprecations
Support for Ruby 1.8.7 and prior has been dropped
You may give the previous version a try, say 1.5.10 / 2013-06-07
For the errors of building native extension, you shall check the build log of Nokogiri. It's likely that your system missed some library dependencies, such as libxml, libyaml, etc. RVM may handle the dependency for you, in its manner, so you don't get error while building with RVM.

How to fix gem install gtk2 in cygwin Ruby on Windows

I choose to use Cygwin for installing ruby on my system than using the usual rubyinstaller way.
Now, just as when I'm trying to install gems I usually use (like gtk2). It squeaks out some errors.
And here's the details: (I'm on Windows 8)
C:\Users\imraven>ruby -v
ruby 1.9.3p327 (2012-11-10 revision 37606) [i386-cygwin]
C:\Users\imraven>gem install gtk2
Building native extensions. This could take a while...
ERROR: Error installing gtk2:
ERROR: Failed to build gem native extension.
/usr/bin/ruby.exe extconf.rb
"C:/Program Files (x86)/git/bin/sh.exe": /usr/bin/ruby.exe: No such file or directory
Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/glib2-1.1.9 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/glib2-1.1.9/ext/glib2/gem_make.out
What should I do to fix this? The main reason why I'm opting for Cygwin's Ruby is that I wanted to use Process.fork method (which is unavailable from the normal RubyInstaller Windows version of Ruby)
Thanks! :)
You may have installed ruby for windows, and not the cygwin version.
Run the Cygwin setup, and choose Ruby, under the Ruby category. Also make sure that you've installed the gcc compiler and GNU make, under the Devel category, so that the gems can build the native extensions.

Resources