Ruby - cannot load such file -- curl - Windows 10 - ruby

The things that i have done so far:
Downloaded: rubyinstaller-devkit-3.0.2-1-x86 32bit
added C:\Ruby30\bin to Path
Downloaded: curl-7.80.0-win32-mingw
added C:\curl-7.80.0-win32-mingw\bin to Path
I used the following command to install curb:
gem install curb -- -- --with-curl-lib=C:\curl-7.80.0-win32-mingw\bin –with-curl-include=C:\curl-7.80.0-win32-mingw\include
It was done: 1 gem installed.
I created the gemfile, went fine apart from seeing this:
Using bundler 2.2.22
Using curb 0.9.11
Fetching unidecoder 1.1.2
but when i wanted to run the ruby app i got this error message:
<internal:C:/Ruby30/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- curb (LoadError)
from <internal:C:/Ruby30/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from crawler.rb:6:in `<main>'
When I type in curb --version
it gives me nothing: 'curb' is not recognized as an internal or external command,
operable program or batch file.
Even if it was installed previously.
Any idea?
also run
gem install curb --verbose --platform=ruby -- --with-curl-lib=C:\curl-7.80.0-win32-mingw\lib --with-curl-include=C:\curl-7.80.0-win32-mingw\include
same load error

Related

Ruby - Can't require gem properly

I'm trying to require the gem 'cerebrum'. I tried requiring it using the irb, and that worked, and also running the program in JRuby worked too. However, Ruby throws a LoadError.
C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- cerebrum (LoadError)
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
What am I doing wrong? Has anyone had that issue too?
You get the load error when gem is not installed. First check if this gem is installed in this ruby version using gem list cerebrum. It may be installed in your jruby that's why it didn't throw error.

Cannot load libxml_ruby.so for libxml-ruby gem

I installed the libxml-ruby gem, with the --platform=x86_64 flag, and whenever I try to require 'xml' I get an error.
Ruby24-x64/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require':
126: The specified module could not be found.
- I:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/libxml-ruby-3.0.0/lib/libxml_ruby.so (LoadError)
I checked, and libxml_ruby.so is in that directory. Any ideas on how to fix this?
I am using Ruby version 2.4.1 on Windows 10.

Problems running rails 2.3.10 bundler `require': no such file to load -- rubygems (LoadError)

I have an app on Rails 2.3.10 on production; when I try to start with ruby script/server -p 3017 -e production -d it throws me the following error:
Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org
try installing passenger to start the project with but it generates another error:
/home/gmcms/.rvm/gems/ruby-1.8.7-p370#nick_backend/gems/bundler-1.3.5/lib/bundler/shared_helpers.rb:2:in `require': no such file to load -- rubygems (LoadError)
from /home/gmcms/.rvm/gems/ruby-1.8.7-p370#nick_backend/gems/bundler-1.3.5/lib/bundler/shared_helpers.rb:2
from /home/gmcms/.rvm/gems/ruby-1.8.7-p370#nick_backend/gems/bundler-1.3.5/lib/bundler/setup.rb:1:in `require'
from /home/gmcms/.rvm/gems/ruby-1.8.7-p370#nick_backend/gems/bundler-1.3.5/lib/bundler/setup.rb:1
I got this project from another developer, and he always started the project this way; before it didn't have a Gemfile, so I created a Gemfile where I defined the gems the project is using and then install everything with bundler adding the parameter --deployment:
bundle install --deployment
I've also followed the steps that are on the official website of bundler:
http://bundler.io/v1.3/rails23.html
But when I try to run the project the same way using ruby script/server it haves me the same error. I followed this threads but none of them worked for me:
http://docs.rubygems.org/read/chapter/15#page66
Rails "no such file to load -- rubygems (LoadError)"
no such file to load -- rubygems (LoadError)
What can I do? Thanks in advance.
Juan Trejo.
I have run into similar issues. Try running
rvm gemset use global && bundle

Including gems in ubuntu 11.04

I've got a problem with running an additional gem under ubuntu 11.04. I installed spiceweasel via gem install - which put it in /var/lib/gems/1.8/gems/spiceweasel. When I try to run it, I get:
`require': no such file to load -- spiceweasel/version (LoadError)
The file is in /var/lib/gems/1.8/gems/spiceweasel-0.7.1/lib/spiceweasel/version.rb but cannot be loaded. This happens both with and without -rubygems.
How do I fix this?
It seems to be the same problem like here: Ruby: require 'irbtools' raises LoadError
The gem author published the gem with wrong permissions. You should contact the gem author.

Trying to run mongo3 gem on Ubuntu 10.10. Help!

I'm trying to run the ruby gem "mongo3" (http://mongo3.com/)
I'm new to gem, but I would think that running "gem mongo3" should execute it, but I get this error:
chris#Zombie:~$ gem mongo3
ERROR: While executing gem ... (RuntimeError)
Unknown command mongo3
So I did "gem which mongo3" and it said it is located at "/var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb". I then ran "ruby /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb" with the following result:
chris#Zombie:~$ ruby /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb
/var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3/node.rb:1:in `require': no such file to load -- json (LoadError)
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3/node.rb:1
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:41:in `require'
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:41:in `require_all_libs_relative_to'
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:41:in `each'
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:41:in `require_all_libs_relative_to'
from /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb:53
I'm not sure what I'm doing wrong - I suspect that ruby and gems are confused about where the gems should be loaded from or something. Thanks!
You don't need to do a gem mongo3 or ruby /var/lib/gems/1.8/gems/mongo3-0.1.3/lib/mongo3.rb. Instead, just simply run mongo3.
Make sure to follow the usage instructions here to configure it or you'll get runtime errors.
Edit: If you don't install the gem using sudo, then you won't have proper write access to /usr/bin, meaning the mongo3 executable will not be in your path. You'll probably see a warning like this when installing:
WARNING: Installing to ~/.gem since /var/lib/gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have /home/chris/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
You have two options: install the gem using sudo gem install mongo3 so it properly links to /usr/bin, or add /home/chris/.gem/ruby/1.8/bin to your path.

Resources