Having a bit of a nightmare getting bluecloth to work on windows. I grabbed the gem from the site (since gem install bluecloth doesnt work). However, I can't seem to get the library to load
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'bluecloth'
LoadError: no such file to load -- bluecloth_ext
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/Ruby/lib/ruby/gems/1.8/gems/bluecloth-2.0.5-x86-mingw32/lib/bluecloth.rb:156
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):2
irb(main):003:0>
any thoughts/suggestions? (besides don't use windows =P)
From http://groups.google.com/group/rubyinstaller/browse_thread/thread/59f3812381a195b5/adb40d04eabefe14?lnk=gst&q=bluecloth#adb40d04eabefe14:
C:\>gem install bluecloth --platform=ruby
Building native extensions. This could take a while...
Successfully installed bluecloth-2.0.5
1 gem installed
C:\>irb -rubygems
irb(main):001:0> require 'bluecloth'
=> true
I ended up using rubyinstaller.org instead of the one click installer, with the devkit plugin. This lets you build native extensions on windows without any headaches. I then got the .gem (not the mingw32 version) from the website, and did a gem install seamlessly.
Related
I can install charlock_holmes gem on opensuse, trying to open it up in irb quickly, I get this:
> irb
2.3.0 :001 > require 'charlock_holmes'
LoadError: /home/wpostma/.rvm/gems/ruby-2.3.0/gems/charlock_holmes-0.7.3/lib/charlock_holmes/charlock_holmes.so:
undefined symbol: _ZTIN6icu_538ByteSinkE - /home/wpostma/.rvm/gems/ruby-2.3.0/gems/charlock_holmes-0.7.3/lib/charlock_holmes/charlock_holmes.so
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/wpostma/.rvm/gems/ruby-2.3.0/gems/charlock_holmes-0.7.3/lib/charlock_holmes.rb:1:in `<top (required)>'
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from (irb):1
from /home/wpostma/.rvm/rubies/ruby-2.3.0/bin/irb:11:in `<main>'
2.3.0 :002 >
It looks to me like maybe something in charlock_holmes is incompatible with the libicu version inside tumbleweed.
I'm using ruby installed with rvm, and purging all my gemsets and reinstalling does not fix it. Any other ways to get charlock_holmes to work? Maybe I need to install a special copy of libicu (earlier, older) and point the gem at it?
Either of these works. For me the bundle config option works better.
This is a direct command to install the gem, directing it towards the correct libicu version:
gem install charlock_holmes -- --with-icu-dir=/usr/local
This is a command to tell which ever ruby project I install later on this system, will get gems installed by bundler to just work instead of breaking:
bundle config build.charlock_holmes "--with-icu-dir=/usr/local" --global
Since I'm using rvm the above bundle configuration seems to be "global" to that rvm environment only.
In my case, the bundle config is helpful as a large series of actions that would have otherwise failed (installing gems, and bootstrapping a large rails application) just worked.
I'm using Archlinux, the ruby location was on /usr/bin/ruby
$ ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]
$ gem install ffi
Building native extensions. This could take a while...
Successfully installed ffi-1.9.0
Parsing documentation for ffi-1.9.0
Done installing documentation for ffi after 41 seconds
1 gem installed
I was using G-WAN to execute a ruby script, but when i use require 'ffi' this output shown:
/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- ffi (LoadError)
from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/asd/bin/gwan_linux32-bit/127.0.0.1_8081/#127.0.0.1/csp/test.rb:1:in `<main>'
and require '/home/asd/.gem/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi.rb' shows:
/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- ffi_c (LoadError)
from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/asd/.gem/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi.rb:14:in `rescue in <top (required)>'
from /home/asd/.gem/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi.rb:3:in `<top (required)>'
from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/asd/bin/gwan_linux32-bit/127.0.0.1_8081/#127.0.0.1/csp/test.rb:21:in `<main>'
the output of p $LOAD_PATH was:
["/usr/lib/ruby/site_ruby/2.0.0" # doesn't exists
, "/usr/lib/ruby/site_ruby/2.0.0/i686-linux" # doesn't exists
, "/usr/lib/ruby/site_ruby" # doesn't exists
, "/usr/lib/ruby/vendor_ruby/2.0.0" # doesn't exists
, "/usr/lib/ruby/vendor_ruby/2.0.0/i686-linux" # doesn't exists
, "/usr/lib/ruby/vendor_ruby" # doesn't exists
, "/usr/lib/ruby/2.0.0"
, "/usr/lib/ruby/2.0.0/i686-linux"
]
the location for FFI was:
$ locate ffi.rb
/home/asd/.gem/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi.rb
/home/asd/.gem/ruby/2.0.0/gems/ffi-1.9.0/lib/ffi/ffi.rb
/opt/jruby/lib/ruby/shared/ffi.rb
/opt/jruby/lib/ruby/shared/ffi/ffi.rb
/opt/jruby/samples/ffi/ffi.rb
so i tried to add the directory to $LOAD_PATH
$LOAD_PATH.unshift '/home/asd/.gem/ruby/2.0.0/gems/ffi-1.9.0/lib'
and now require 'ffi' shows no error..
if i already have many gems installed on ~/.gem/ruby/2.0.0/gems
$ ll ~/.gem/ruby/2.0.0/gems/ | wc
285 2558 17502
what is the correct way to use the gem? is it by adding each path to $LOAD_PATH
This is clearly a Ruby configuration issue, and the suggested RVM tool seems to address it:
RVM is a command-line tool which allows you to easily install, manage,
and work with multiple ruby environments from interpreters to sets of
gems.
As suggested by 'icktoofay', G-WAN could add support for RVM, but I am not sure that it makes sense unless RVM becomes more mainstream than Ruby itself (or assimilated by Ruby).
Now, Jesly Varghese also told us (above) that the issue comes from the fact "you are using system ruby, and calling a gem in user dir".
Did you try to install G-WAN under /opt/gwan ?
Then, this PATH issue may be gone.
I have installed the sys-proctable gem on a fresh Ubuntu image (running via Vagrant)
with Ruby 1.8.7.
vagrant#precise64:~$ gem list
*** LOCAL GEMS ***
bunny (0.7.9)
chef (10.14.2)
...many, many gems more
sys-proctable (0.9.3 universal-linux)
systemu (2.5.2)
treetop (1.4.10)
uuidtools (2.1.3)
yajl-ruby (1.1.0)
now I want to load it into irb
vagrant#precise64:~$ irb
irb(main):001:0> require 'sys/proctable'
LoadError: no such file to load -- sys/proctable
from (irb):1:in `require'
from (irb):1
from :0
so what is the issue here?
You may need to require rubygems first. I think then it will work.
Also: are you sure you need to use a / and not a -?
Obviously you managed to load it...
Just wanted to make sure everything is written.
It's definitely a / that's required.
This should work :
require 'rubygems'
require 'sys/proctable'
....
This is my first program :
require 'rubygems'
require 'watir'
ie = Watir::IE.new
ie.goto("http://www.google.com")
ie.text_field(:name, "question").set("microsoft")
ie.button(:name, "btnG").click
When I run it,I get the following error, could you please help. I have installed watir-webdriver before running this
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- watir (LoadError)
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/FirstSample:2:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
My guess is that the problem is caused by the fact that you have installed watir-webdriver gem but you are requiring watir gem.
Either install watir gem or require watir-webdriver gem in your code.
I've just replied to your other question with a sample project and instructions regarding DevKit installation.
Note that RubyMine needs a valid Gemfile to manage dependencies. All the gems that you are using should be specified in that file. bundle install should install the dependencies without errors.
If you have errors installing gems, post it as a separate question with more details, but before doing it verify that DevKit was installed properly and can build/run the sample gem from the installation guide.
Some gems may be not fully compatible with the recently released Ruby 2.0 version. If you have no luck getting it to work, try Ruby 1.9.3 instead.
I've somehow broken my ruby configuration, and I'm not sure how to fix it. Here's an irb session:
>> require 'ruby-debug'
LoadError: dlsym(0x101a272d0, Init_ruby_debug): symbol not found - /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle
from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby-debug-base.rb:1
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug.rb:5
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):1
Here's my ruby version:
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-darwin10]
I'm not sure how to go about diagnosing and fixing this. Any suggestions? What other info should I provide?
Reinstalling the gem didn't fix it:
$ sudo gem install ruby-debug
Password:
Successfully installed ruby-debug-0.10.3
1 gem installed
Installing ri documentation for ruby-debug-0.10.3...
Installing RDoc documentation for ruby-debug-0.10.3...
maybe it's missing some dependency .so file? I would use ldd -l to determine this in linux, dunno about mac.
Doing a fresh install of 1.8.7 via rvm fixed this problem for me.