RubyMine debug not working - ruby

I cannot get debug mode working in RubyMine. Below is what I did to install it all. This is followed by the error details and my setup
Any advice please
A Download and Install Ruby
1.Download Ruby 2.2.6 - http://rubyinstaller.org/downloads/
2.Install Ruby 2.2.6 to C:\Ruby
B Download Ruby Dev kit
3.Return to http://rubyinstaller.org/downloads/
4.Under development click on "https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe"
5.Create Folder C:\Ruby\DevKit
6.Unzip "DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe" into C:\Ruby\DevKit
8.Go to folder C:\Ruby\DevKit , Now press Shift then right click "Open command window here"
9.Type "ruby dk.rb init" in command prompt and hit enter (c:\DevKit>ruby dk.rb init)
10.Type "ruby dk.rb install" in command prompt and hit enter (c:\DevKit>ruby dk.rb install)
C Install RubyGems
11.Open command prompt and type the following commands and hit enter every time
c:\gem install bundler
Then navigate to your project folder where the Gemfile located and run command 'bundle install'
D Download and Install Ruby Mine
13.Open http://www.jetbrains.com/ruby/download/
14.Click on 30 days Trial "Download Now"
15.Now Install Ruby Mine
From this point I can load projects and run projects but when I try to debug the
same project I get issues.
The message is Test framework quit unexpectedly
C:\Ruby\bin\ruby.exe -EUTF-8 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Ruby/lib/ruby/gems/2.2.0/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide --disable-int-handler --evaluation-timeout 10 --rubymine-protocol-extensions --port 62718 --host 0.0.0.0 --dispatcher-port 62719 -- C:\Ruby\bin/cucumber C:/git/wiggle-automation/features/checkout.feature --format Teamcity::Cucumber::Formatter --expand --color -r features
Testing started at 15:58 ...
C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- debase_internals (LoadError)
from C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/debase-0.2.2.beta10/lib/debase.rb:4:in `<top (required)>'
from C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:8:in `<top (required)>'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in `require_relative'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
So with this in mind I try to install debase – gem install debase
And I get this
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing debase:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe -r ./siteconf20170726-16784-15t9wif.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
creating Makefile
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby/lib/ruby/gems/2.2.0/gems/debase-0.2.1 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/debase-0.2.1/gem_make.out
So I look at the gem_make.out file as above and I see this
C:/Ruby/bin/ruby.exe -r ./siteconf20170726-21048-1y9auxw.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
creating Makefile
extconf failed, exit code 1
Can anyone explain what is happening please.
I am using Windows 7 and Ruby 2.2.6p396

OK got this working now.
I opened the Command Prompt as Administrator and then executed the following
c:\gem install ruby-debug-ide
c:\gem install debase
This time they both executed with no error.
I then restarted RubyMine and now I can run in debug mode.
Happy days....

Related

Installing and running jekyll on Windows 10

I tried Github pages on Friday and found it great so decided to install Jekyll locally (Windows 10) so I could build and test offline. After spending almost a day and trying multiple recipes (from theserverside.com, jekyllrb.com, etc) for how to install Jekyll I finally got jekyll -v to work. (Note that the instructions I found weren't bad but probably just out of date. People need to updates their blogs, or better people should stop changing how things are set up!)
However, now when I try to serve a test site I get a Segmentation fault (as below). I have tried starting again from scratch several times and even strangely get different results but have never gotten as far as serving the site.
$ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]```
$ jekyll -v
jekyll 4.2.2
$ jekyll new myblog
...
$ cd myblog
$ bundle exec jekyll serve
Configuration file: e:/Work/tmp/Daily/blog/myblog/_config.yml
Source: e:/Work/tmp/Daily/blog/myblog
Destination: e:/Work/tmp/Daily/blog/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/lib/sassc/engine.rb:43: [BUG] Segmentation fault
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
-- Control frame information -----------------------------------------------
c:0033 p:---- s:0182 e:000181 CFUNC :compile_data_context
c:0032 p:0314 s:0177 e:000176 METHOD C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/lib/sassc/engine.rb:43
...
[+576 more lines of backtrace and runtime info - available on request]
Thanks for any help you can give me to get Jekyll working.
BTW I don't like to complain but getting Ruby and Jekyll installed and running has been a royal pain. Maybe I have been spoilt with Go which literally took less than 10 minutes to install and have a running program (though calling C from Go (using CGO) took me a few hours to get working). Moreover, if Jekyll was written in Go it would a simple matter of downloading a single jekyll.exe - ie a few minutes instead of days (or however long it takes to get this working).
Update: I have tried lots of things with varying results but I never get as far as Jekyll serving the site. I don't know enough about Ruby and/or understand what the error messages mean to try to fix these things so I have now taken to documenting exactly what I tried and the result. Here are the last 4 things I tried and the result:
================================
Using Ruby 3.1.2.1 + Devkit (x64) and following instructions at https://jekyllrb.com/docs/installation/windows/ which run without error but then serving a test site has an error:
$ jekyll -v
jekyll 4.2.2
$ jekyll new myblog
...
New jekyll site installed in D:/myblog.
$ cd myblog
$ bundle exec jekyll serve
Configuration file: D:/myblog/_config.yml
Source: D:/myblog
Destination: D:/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 1.829 seconds.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for 'D:/myblog'
------------------------------------------------
Jekyll 4.2.2 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `require':
cannot load such file -- webrick (LoadError)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:179:in `require_relative'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:179:in `setup'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:100:in `process'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `each'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/exe/jekyll:15:in `<top (required)>'
from C:/Ruby31-x64/bin/jekyll:32:in `load'
from C:/Ruby31-x64/bin/jekyll:32:in `<main>'
=======================================
Using Ruby 3.1.2-1 and following instructions at https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/jekyll-install-windows-example-blog-tutorial after a lot of trial and error I eventually got jekyll serve to run but it said "generating feed" then stopped and there was no server running at http://localhost:4000.
=======================================
Using Ruby 3.0.4-1 (x64) and following instructions at https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/jekyll-install-windows-example-blog-tutorial I get to the very end but when I try to serve the a test site I get:
$ bundle exec jekyll serve
Configuration file: D:/myblog/_config.yml
Source: D:/myblog
Destination: D:/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 0.758 seconds.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for 'D:/myblog'
------------------------------------------------
Jekyll 4.2.2 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
...
===================================
Using Ruby 2.7.0.1 and following instructions at https://gist.github.com/arthurattwell/281a5e1888ffd89b08b4861a2e3c1b35 I get as far as the ridk install and which fails:
$ ridk install
...
Which components shall be installed? If unsure press ENTER [1,2,3]
> sh -lc true
MSYS2 seems to be properly installed
Remove catgets to avoid conflicts while update ...
> pacman -Rdd catgets libcatgets --noconfirm
error: target not found: catgets
error: target not found: libcatgets
MSYS2 system update (optional) part 1 ...
> pacman -Syu --needed --noconfirm
:: Synchronizing package databases...
mingw32 is up to date
mingw64 is up to date
ucrt64 is up to date
clang32 is up to date
clang64 is up to date
msys is up to date
:: Starting core system upgrade...
there is nothing to do
:: Starting full system upgrade...
there is nothing to do
MSYS2 system update (optional) succeeded
MSYS2 system update (optional) part 2 ...
> pacman -Su --needed --noconfirm
:: Starting core system upgrade...
there is nothing to do
:: Starting full system upgrade...
there is nothing to do
MSYS2 system update (optional) succeeded
Install MSYS2 and MINGW development toolchain ...
> pacman -S --needed --noconfirm autoconf autoconf2.13 autogen automake-wrapper automake1.10 automake1.11 automake1.12 automake1.13 automake1.14 automake1.15 automake1.6 automake1.7 automake1.8 automake1.9 diffutils file gawk grep libtool m4 make patch pkg-config sed texinfo texinfo-tex wget mingw-w64-x86_64-binutils mingw-w64-x86_64-crt-git mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-headers-git mingw-w64-x86_64-libmangle-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-make mingw-w64-x86_64-pkg-config mingw-w64-x86_64-tools-git mingw-w64-x86_64-winpthreads-git
error: target not found: automake1.10
error: target not found: automake1.6
error: target not found: automake1.7
error: target not found: automake1.8
error: target not found: automake1.9
warning: file-5.41-4 is up to date -- skipping
warning: gawk-5.1.1-1 is up to date -- skipping
warning: grep-1~3.0-3 is up to date -- skipping
warning: sed-4.8-3 is up to date -- skipping
warning: wget-1.21.3-1 is up to date -- skipping
Install MSYS2 and MINGW development toolchain failed
Installation failed: pacman failed
I got it to work using the instructions at www.theserverside.com and installing Ruby 2.7.6
Note that the install of Ruby messed with msys/mingw and now when I try to debug my Go program I get this error:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../lib/libmsvcrt.a(/359): duplicate symbol reference: _unlock_file in both libgcc(.text) and libgcc(.data)
libgcc(.text): relocation target ___chkstk_ms not defined
libgcc(.text): relocation target atexit not defined
but I guess that is a new question

How to use system Ruby instead of rbenv on a per-project basis?

I'm using my work laptop to contribute to a non-work open-source project. At work we use rbenv to manage Ruby versions, but the open-source project appears to expect gem dependencies to be located in the system Ruby install folder. So when I try to run certain of the project's commands, I'm running into missing gem errors.
The project is Homebrew, and the command I'm running is brew style. When I run the command in my local, I get the following:
Ignoring rainbow-2.2.2 because its extensions are not built. Try: gem pristine rainbow --version 2.2.2
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rainbow (LoadError)
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/richie.thomas/.gem/ruby/2.3.0/gems/rubocop-0.50.0/lib/rubocop.rb:4:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/richie.thomas/.gem/ruby/2.3.0/gems/rubocop-0.50.0/bin/rubocop:6:in `<top (required)>'
from /Users/richie.thomas/.gem/ruby/2.3.0/bin/rubocop:22:in `load'
from /Users/richie.thomas/.gem/ruby/2.3.0/bin/rubocop:22:in `<main>'
Running gem environment returns the following:
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.10
- RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /Users/richie.thomas/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: /Users/richie.thomas/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /Users/richie.thomas/.rbenv/versions/2.3.3/bin/ruby
- EXECUTABLE DIRECTORY: /Users/richie.thomas/.rbenv/versions/2.3.3/bin
- SPEC CACHE DIRECTORY: /Users/richie.thomas/.gem/specs
....
I've been advised by other contributors that the easiest path forward would be to disable or uninstall rbenv in order to run the command. I'd really like to avoid uninstalling and reinstalling rbenv every time I want to run this command, but there is nothing in the rbenv documentation that mentions this.
Is there any one-time command I can run, or any configuration setting I can change, so that I can do what I need to do?
I re-ran gem environment and noticed that the following environment variables were defined:
INSTALLATION DIRECTORY: /Users/richie.thomas/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0
USER INSTALLATION DIRECTORY: /Users/richie.thomas/.gem/ruby/2.3.0
The value of INSTALLATION DIRECTORY is what I expected to be used to run the command, and I noticed the value of USER INSTALLATION DIRECTORY is what showed up in the error stacktrace.
Since I was unable to figure out how my machine was determining which variable to use, I simply renamed ~/.gem/ to ~/.gem2/ and re-ran the brew style command I originally wanted. This was successful!

RubyMine debugger error

i'm using RubyMine 6.3 buth I have some problems with debugger
C:\Ruby200\bin\ruby.exe -e
$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide
--disable-int-handler --port 49883 --dispatcher-port 49884 -- C:/Ruby200/Projekty/123/test
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- debase_internals (LoadError) from
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require' from
C:/Ruby200/lib/ruby/gems/2.0.0/gems/debase-0.0.9/lib/debase.rb:4:in
<top (required)>' from
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require' from
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require' from
C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:8:in
' from
C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide:8:in
require_relative' from
C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide:8:in
' from -e:1:in load' from -e:1:in'
Process finished with exit code 1
But when use Ruby Interactive Console, all is working. When I use Komodo IDE all is fine.
I fixed my issue by installing debase manually from the terminal, not from the one bundled with rubymine, try it
gem install debase
PS: I was using ruby 1.9.3
Adding the following to my Gemfile made debugging and rails commands work (versions: Rubymine 7.0.4, ruby 2.3.1 and rails 4.2.6):
group :development do
gem 'ruby-debug-ide', '0.4.24'
gem 'debase', '0.2.1'
end
Just spent 6 hours working through this, and just in case this helps others, here is what I did:
Upgraded to latest version of RubyMine (downloaded 7.0 from JetBrains site)
Upgraded to Ruby 2.1.2
Opened RubyMine > File > Default Settings > Ruby SDK & Gems > Selected ruby-2.1.2 > Clicked '+' on right hand side > Installed cucumber and calabash-cucumber
RubyMine > Run > Edit Configurations > changed the SDK to ruby-2.1.2
And it worked. Hopefully this might help others new to Calabash / Ruby / RubyMine
Martins-MacBook-Pro:~ martincleaver$ sudo gem install debase -v 0.0.9
Password:
ERROR: Error installing debase:
ERROR: Failed to build gem native extension.
checking for vm_core.h... no
No source for ruby-2.0.0-p648 provided with debugger-ruby_core_source gem.
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details.
$ more /Library/Ruby/Gems/2.0.0/gems/debase-0.0.9/ext/gem_make.out
checking for vm_core.h... no
Makefile creation failed
Check the mkmf.log file for more details
$ more /Library/Ruby/Gems/2.0.0/gems/debase-0.0.9/ext/mkmf.log
have_header: checking for vm_core.h... -------------------- no
conftest.c:3:10: fatal error: 'vm_core.h' file not found
#include <vm_core.h>
--------------------
https://github.com/denofevil/debase/issues/9 tracks the issue from the gem standpoint. It's the best place to discuss the matter.
That said, iheggie's answer at https://stackoverflow.com/a/37086441/722034 worked for me.
Updating Rubymine to the latest version (and waiting for reindexing to finish, which can be quite long) helped fix some problems cf https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009522340-Unable-to-use-debugger-debase-0-3-0-beta34-install-error-

nokogiri.so LoadError maybe problem with libiconv on Solaris

I'm trying to get the Ruby gem "Nokogiri" running on a Solaris machine where I don't have root priviledges. What I've done so far:
I've build my own ruby version (1.9.2p180) in my home directory
tried to install nokogiri with "gem install nokogiri"
The gem install then throwed this error:
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/home/bender/ruby/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for iconv_open() in iconv.h... no
checking for iconv_open() in -liconv... no
-----
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
So I downloaded and build the libiconv in /home/myuser/work/libiconv
$ ls /home/myuser/work/libiconv/
bin build include lib share
And passed the locations as arguments for nokogiri:
gem install nokogiri -- --with-iconv-dir=/home/myuser/work/libiconv --with-iconv-include=/home/myuser/work/libiconv/include --with-iconv-lib=/home/myuser/work/libiconv/lib
Now the gem builds and no errors are displayed. The problem is, when I now try to use it, e.g. in irb it somehow fails to load:
require 'nokogiri'
LoadError: ld.so.1: ruby: fatal: libiconv.so.2: open failed: No such file or directory - /home/myuser/ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4/lib/nokogiri/nokogiri.so
from /home/myuser/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/myuser/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/myuser/ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4/lib/nokogiri.rb:13:in `<top (required)>'
from /home/myuser/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:57:in `require'
from /home/myuser/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:57:in `rescue in require'
from /home/myuser/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from (irb):1
from /home/myuser/ruby/bin/irb:12:in `<main>'
But when I look for the file which should be missing it is there and also readable/executable:
ll /home/myuser/ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4/lib/nokogiri/
total 66
...
-rwxr-xr-x 1 myuser group 370552 Jun 6 22:53 nokogiri.so
...
Ok, and that is where I'm stuck.. the file is there but can't be opened? I tried to rebuild the libiconv which had no effect. Nokogiri doesn't throw any error that the build process fails. So I don't know how to solve this and google could't give me answers either. I hope somebody here can give me some hints.
/edit
I googled around some more and found this post where somebody uses ldd to show dependencies. When I do the same for nokogiri it says:
ldd /home/myuser/ruby/bin/nokogiri
ldd: /home/myuser/ruby/bin/nokogiri: unsupported or unknown file type
I guess this is because its a ruby file but in case it is relevant I want to mention it.
If you're using GNU binutils, then try to set
LDFLAGS="-Wl,-rpath /home/myuser/work/libiconv/lib"
if it's a Solaris linker, then it's something like -X, I don't really remember. Just check the man page of ld for runpath settings. It'll allow the run-time linker to find the .so.
If you're going to build your own sandbox, why not use RVM to do all the heavy lifting? Its purpose in life is to create a user sandbox in ~/.rvm, build and manage the Ruby versions you want to run and the gemsets associated with your projects.
If you decide to go that path, which I recommend highly, be sure to follow the single-user installation directions on the linked page, to add the appropriate string to your ~/.bash_profile or ~/.bashrc if you you don't use a *profile file, and follow the recommendations RVM outputs when you run rvm notes.
I have it installed on several Centos, Ubuntu and Mac OS boxes where I do development, and think it's great.

Unable to use TicGit: Problem with Ruby

I am trying to use Ticgit by running
ti
I get the following error message
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- git (LoadError)
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/schacon-ticgit-0.3.6/lib/ticgit.rb:8
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/schacon-ticgit-0.3.6/bin/ti:9
from /opt/local/bin/ti:19:in `load'
from /opt/local/bin/ti:19
The problem may be related to MacPorts. It complains that I need to update my Xcode to the newest version, although I have the newest version.
The first line in the error message is strange, since I have the file.
What does the error message tell you?
Do you have the git rubygem installed?
"/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- git (LoadError)" means you don't have the ruby library available in your load path, not that you don't have the git binary installed.
run 'gem list -l git' and if it doesn't find the library, run 'gem install git'

Resources