Typhoeus Windows installation - ruby

Tried installing Typhoeus on a Windows 7 environment. Gem installs successfully but when trying to run a simple ruby script::
require 'typhoeus'
Typhoeus.get("www.google.com", verbose: true)
I get the following error::
D:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.9.3-x86-mingw32/lib/ffi/library.rb:133:in `block in ffi_lib': Could not open l
(LoadError)url': The specified module could not be found.
.
Could not open library 'libcurl.dll': The specified module could not be found.
.
Could not open library 'libcurl.so.4': The specified module could not be found.
I tried adding curl.exe and libcurl.dll that I found in one of the packages on the curl website but that didn't help. Not sure what to do at this point. Thnks.

Seem to have figured it out. If anyone is having the same issue, make sure to download the following package from curl.haxx.se/download.html
Win32 2000/XP zip 7.34.0 libcurl SSL Günter Knauf 3.34 MB
Extract the bin directory to wherever and make sure to add it to your PATH. I also added .DLL to PATHEXT reset comp and it worked.

I just had the same problem on Windows 7 x64 and answered about it here. Typhoeus requires Ruby-FFI (see this answer) and libcurl.
The accepted answer is a little out of date now, but the same idea works:
Get a libcurl.dll from one of the packages here:
https://curl.haxx.se/gknw.net/7.40.0/dist-w64/ and put it on the PATH.
(I did not add .DLL to the PATHEXT)

Related

Has anyone managed to add custom icons into Ionic in Windows?

I refer the instructions here
What I did (on Windows):
Install fontforge through web instead of 'brew'
Install SASS through Ruby GEM
Place my-icon.svg inside src/ (of the ionicons-master)
Run the python ./builder/generate.py
I think I am very closed. Until i saw this error message:
windowsError: The system cannot find the file specified
And I think I get even closer when I saw the last post of this link
But, I don't get what it means. I downloaded the .exe but it doesn't work.
Is it the python build only meant for MAC? Has anyone managed to make this work in Windows?

PHPDocumentor - Graphviz 'dot' command not found

I am trying to get PHPDocumentor running on a local XAMPP installation.
Sadly I having a hard time doing it using package managers.
Some basic questions about package managers first:
How do I know where to install a package? For example: I installed PHPDocumentor using Composer. I go to my C:\xampp\htdocs\ and run a command:
composer require "phpdocumentor/phpdocumentor:2.*"
This installs phpdocumentor in a " vendor" folder in xampp\htdocs\
Is this the correct path to install all these packages or is there a default dir to install this?
If I want to uninstall the packages, do I simply delete the "vendor" dir?
After the installation I ran PHPdocumentor and got an error:
Unable to find the dot command of the GraphViz package. Is GraphViz
correctly installed and present in your path?
To resolve this, I tried the following:
Installed the package graph/graphviz while my pointer was in the htdocs-folder and pointed a path to the folders:
C:\xampp\htdocs\vendor\graph\graphviz
...graph\graphviz\src
...graph\graphviz\tests
None of the above solved the problem.
According to this link I have to add the \graphiz\bin directory to path, but there is no "bin" dir?
Can anyone help me out with this?
Best regards,
Abayob
Unable to find the dot command of the GraphViz package. Is GraphViz correctly installed and present in your path?
The steps to resolve this error are:
download zip from https://graphviz.gitlab.io/_pages/Download/Download_windows.html
extract to c:\some\where\graphviz
add c:\some\where\graphviz\bin to your environment variable PATH
run phpdoc
I don't like to have 184MB of usefull stuff on my PC just to run the 'dot' command?
Yes, its a lot of stuff. A more lightweight solution would be nice.

Using curb gem and libcurl on Windows

I am trying to install the curb gem, which is libcurl bindings for Ruby, and of course I need to have "A working (lib)curl installation, with development stuff" installed on my computer. So, I went to the cURL Download Wizard and downloaded this package.
But adding the bin into my PATH does not produce improvement and I still get an error when I try to install the curb gem, such as:
extconf.rb:19: Can't find libcurl or curl/curl.h
(RuntimeError)
Even though, curl is already in the PATH.
EDIT: I also tried raking the gem, as per the instructions. It fails saying "make failed" and throwing a bunch of errors like this:
C:/Ruby/lib/ruby/gems/1.8/gems/curb-0.7.7.1/ext/curb_postfield.c:76:
undefined reference to
`_imp__curl_formadd'
Execute Below command for windows only and its works
gem install curb --platform=mswin32
I realise this is a very old question, but I had this exact problem today and found the instructions on someone else's site. These worked for me so I thought I would share them since people with this issue are most likely to come across StackOverflow first: http://jes.al/2012/10/installing-curb-gem-on-windows-7/
In a nutshell:
Get the 32-bit development version of curl (see my notes below)
Add the curl bin directory to your PATH
Run the following command (replacing the paths to curl as necessary)
gem install curb --platform=ruby -- -- --with-curl-lib="C:/curl-7.27.0-devel-mingw32/bin" --with-curl-include="C:/curl-7.27.0-devel-mingw32/include"
A couple of personal notes:
Even though I am on 64-bit Windows 7, I had to download the 32-bit libcurl version under "Win32 - Generic", identified as "Win32 2000/XP zip".
I got the error c:/Ruby193/lib/ruby/1.9.1/mkmf.rb:246:in 'initialize': Permission denied - mkmftmp1.log (Errno::EACCES) while installing the gem. This rather messed up page here suggested that it might be a problem with my anti-virus, and that just retrying a couple of times might work, and indeed, it did.

pg.so problem with Ruby in Windows

I have installed the pg module with help of
gem install pg
Which returned
Successfully installed pg-0.8.0-x86-mswin32-60
When a .rb-file looks like this
require 'rubygems'
require 'pg'
I get an LoadError (exception 126) which tells me that it can't find the module C:/Ruby/lib/ruby/gems/1.8/gems/pg-0.8.0-x86-mswin32-60/lib/pg.so.
I heard something about that it is a Linux compilation. I'm really stuck so I really welcome suggestions.
I have also installed PostgreSQL, I use Windows XP.
Perhaps it's not pg that's missing but some other dependency? Perhaps devkit?: http://blog.smajn.net/2009/07/installing-ruby-191-rails-232-and.html
pg gem depends on PostgreSQL DLL being in the PATH.
In case the required DLL is not found, Ruby will throw a loading error about pg.so
Please check that PostgreSQL binaries and DLL are in the PATH:
SET PATH
Or copy the required DLL (pq.dll) has been copied to Ruby installation directory.
I recommend read this blog article about setting PostgreSQL with new RubyInstaller (One-Click Installer successor):
Install Ruby 1.9.1 and Rails 2.3.2 on Windows Vista
Hope that helps.
I just wrestled with this myself.
1) Make sure C:\Program Files\PostgreSQL\8.4\bin is in your path (as Luis suggested)
2) Make sure the libeay32.dll and ssleay32.dll from C:\Program Files\PostgreSQL\8.4\bin are loaded first. In my case I copied them over from C:\ruby\bin, which (in my case) is first in my path.
I was getting errors like
The ordinal 4046 could not be located in dynamic link library LIBEAY32.dll
and
The ordinal 284 could not be located in the dynamic link library SSLEAY32.DLL
until I did step 2)
Good luck...

Ruby cannot find sqlite3 driver on windows

I am trying to set up Ruby on Rails on windows. I am using the Flash Rails distribution that looks pretty good, but there is an issue with sqlite3. I found the threads telling me to install version 1.2.3, which installed fine. I'm using ruby 1.9.0, and every time I try and run a script (e.g. rake db:create) that uses the database I get an error message "no driver for sqlite3 found".
This apparently is a missing sqlite3.dll, but I have the dll in my %PATH%, and I have also tried copying it into the directory where I am running the script from, the directory where the sqlite3 ruby code lives.
Does anyone have any ideas? If possible I want all teh ruby stuff to be self contained so I can use it from a pen drive.
EDIT: To clarify, I already used gem install to install the ruby-sqlite3 gem - it is just non functional as it cannot find the sqlite3.dll (even though it is actually present in a directory on my %PATH%)
EDIT PART 2: After doing some more digging, the problem appears that ruby will not load the sqlite3_api.dll. I have copied it all over my filesystem, I just get a failure to read file. Other dll libraries in the same directory (e.g. zlib.dll) work fine!
I tried installing the dlls into system32, and that did not work either.
The problem put simply is that sqlite3-ruby 1.2.3 is not compatible with ruby 1.9. This is caused because ruby 1.9 does not use .dll files for c libraries it uses .so files instead. Additionally, since sqlite3_api.dll is written against msvcrt-ruby18.dll. This means that it specifically only will support ruby 1.8.*.
The good news is that there is a fat binary version that will support both ruby 1.8 and ruby 1.9. Uninstalling all former versions of sqlite3-ruby and then installing this one. (You may have to manually delete some versions the gem after uninstalling.) in order to install it use
install sqlite3-ruby --source http://gems.rubyinstaller.org
for more information see this website
Try installing the sqlite3-ruby gem:
gem install sqlite3-ruby
Something similar happened to me recently so I thought I'd update my answer.
For reference there's a sqlite3_api.dll file located in the gem's lib directory. Also the sqlite3.dll file needs to be reachable on the path. They are different files, the first is required by the gem to interface Ruby to C code, while the second contains the actual Sqlite implementation.
It's best to get the second file from the sqlite website and extract it to the Ruby\bin directory (as you shouldn't manually put DLL's into the windows or windows\system directories any more).
So for reference "sqlite3_api.dll" needs to be in:
Ruby\lib\ruby\gems\1.8\gems\sqlite3-ruby-1.2.3-x86-mswin32\lib
and "sqlite3.dll" needs to be on the path, possibly in:
Ruby\bin
As for the "driver not found" problem I would suggest trying the easy things first and making sure gems is installed correctly, up to date, and that the RUBYLIB and PATH environment variables are set appropriately. (System restart may be required to propagate the changes fully.)
Re this link
Download sqlitedll-3_6_10.zip and extract into ruby/bin!
Try going to sqlite.org download page and get the zipped up dll. Then put that in your c:\windows\system32 folder, that should allow Ruby to find it.
Restart your machine after running install sqlite3-ruby
To clarify, which gem are you using? sqlite-ruby or sqlite3-ruby?
They're part of the same project, but different releases. The key is that sqlite3 appears to have driver code included.
I assume you're attempting to use the first, since it's giving me the same error. If so, try switching.
Also.. How literal do you mean by this?
but I have the dll in my %PATH%
PATH=...;C:\sqlite\sqlite3.dll
PATH=...;C:\sqlite
The first will attempt to find C:\sqlite\sqlite3.dll\sqlite3.dll, AFAIK.
I use Ruby 1.8.7 (works with 1.9.1 too)
OS is WindowsXP SP3
Go to
http://www.sqlite.org/download.html
and Download file
sqlitedll-3_7_0_1.zip (265.19 KiB)
and unzip then we will get
sqlite3.dll
Copy sqlite3.dll to your bin folder
as C:\Ruby191\bin or C:\Ruby187\bin
then it works

Resources