Unable to Install dm-sqlite-adapter Gem on Windows PC - ruby-on-rails

I am new to Ruby/Sinatra and I am trying to install the DataMapper SQLite Adapter. When I run gem install dm-sqlite-adapter I get the message below. I did previously install sqlite3 using the command gem install sqlite3. However, if I try to call gem install sqlite3 --platform=ruby, I get errors.
c:\Ruby_Dev_Kit>gem install dm-sqlite-adapter
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing dm-sqlite-adapter:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for sqlite3.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby200-x64/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/
Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/do_sq
lite3-0.10.13 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/do_sqlite3-0.10.13/ext
/do_sqlite3/gem_make.out
I have tried multiple different approaches to get around this issue. I was able to install the Ruby Development Kit as I was able to install the JSON gem. Similarly I downloaded the SQLite source code from SQLite.org but I was not able to figure out how to properly configure all aspects of the amalgamation to be found by the tool. Below is the mkmf.log's value:
have_header: checking for sqlite3.h... -------------------- no
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -I/usr/local/include -I/opt/local/include -I/usr/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wall -DHAVE_NO_DATETIME_NEWBANG conftest.c -L. -LC:/Ruby200-x64/lib -L/usr/local/ -L/opt/local/ -L/usr/ -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
"x86_64-w64-mingw32-gcc -E -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -I/usr/local/include -I/opt/local/include -I/usr/include -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wall -DHAVE_NO_DATETIME_NEWBANG conftest.c -o conftest.i"
conftest.c:5:21: fatal error: sqlite3.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <sqlite3.h>
/* end */
--------------------
I tried many different things to get it working, and I realize this may be a stupid question. However, at this point, I am out of ideas. Any assistance would be really appreciated.
System Information:
Windows 7 64 bit
Ruby Version: 2.0.0 p247 x64
Installer - Standard Ruby Exe Installer

I eventually was able to work around this issue. For those who run into this on the future, Bosko Ivanisevic wrote a great guide how to work around this.
See here: http://rubyonwindowsguides.github.io/book/ch02-05.html
Many details in there to be careful about so be sure to read through it step by step and follow everything exactly. Great explanation.

Related

Ruby on Rails won't install on MacOS Sierra

I was following the instructions here: http://installrails.com/
(I also tried using rbenv instead of rvm)
After entering
sudo gem install rails
this is the error I get:
Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.7.1/ext/nokogiri /usr/local/opt/ruby/bin/ruby -r ./siteconf20170417-52755-r3zm64.rb extconf.rb checking if the C compiler accepts ... yes checking if the C compiler accepts
-Wno-error=unused-command-line-argument-hard-error-in-future... no Building nokogiri using packaged libraries. Using mini_portile version
2.1.0 checking for iconv.h... yes checking for gzdopen() in -lz... yes checking for iconv using --with-opt-* flags... yes
************************************************************************ IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.4 with the following patches applied:
- 0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch
- 0002-Fix-XPointer-paths-beginning-with-range-to.patch
- 0003-Disallow-namespace-nodes-in-XPointer-ranges.patch
Team Nokogiri will keep on doing their best to provide security updates in a timely manner, but if this is a concern for you and want to use the system library instead; abort this installation process and reinstall nokogiri as follows:
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
Note, however, that nokogiri is not fully compatible with arbitrary versions of libxml2 provided by OS/package vendors.
************************************************************************ Extracting libxml2-2.9.4.tar.gz into tmp/x86_64-apple-darwin15.6.0/ports/libxml2/2.9.4... OK Running git apply with /usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.7.1/patches/libxml2/0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch... OK Running git apply with /usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.7.1/patches/libxml2/0002-Fix-XPointer-paths-beginning-with-range-to.patch... OK Running git apply with /usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.7.1/patches/libxml2/0003-Disallow-namespace-nodes-in-XPointer-ranges.patch... OK Running 'configure' for libxml2 2.9.4... OK Running 'compile' for libxml2 2.9.4... ERROR, review '/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.7.1/ext/nokogiri/tmp/x86_64-apple-darwin15.6.0/ports/libxml2/2.9.4/compile.log' to see what happened. Last lines are:
======================================================================== /usr/local/lib/ruby/gems/2.4.0/gems/make-0.3.1/bin/make:4:in `<top (required)>': undefined local variable or method `make' for main:Object (NameError) from /usr/local/bin/make:22:in `load' from /usr/local/bin/make:22:in `<main>'
========================================================================
*** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options: --with-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/local/Cellar/ruby/2.4.0/bin/$(RUBY_BASE_NAME) --help --clean --use-system-libraries --enable-static --disable-static --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --enable-cross-build --disable-cross-build /usr/local/lib/ruby/gems/2.4.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:366:in `block in execute': Failed to complete compile task (RuntimeError) from /usr/local/lib/ruby/gems/2.4.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in `chdir' from /usr/local/lib/ruby/gems/2.4.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in `execute' from /usr/local/lib/ruby/gems/2.4.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:111:in `compile' from /usr/local/lib/ruby/gems/2.4.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:150:in `cook' from extconf.rb:364:in `block (2 levels) in process_recipe' from extconf.rb:257:in `block in chdir_for_build' from extconf.rb:256:in `chdir' from extconf.rb:256:in `chdir_for_build' from extconf.rb:363:in `block in process_recipe' from extconf.rb:262:in `tap' from extconf.rb:262:in `process_recipe' from extconf.rb:547:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-15/2.4.0/nokogiri-1.7.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.7.1 for inspection. Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-15/2.4.0/nokogiri-1.7.1/gem_make.out
And the mkmf.log file says
"clang -o conftest
-I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/x86_64-darwin15 -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/usr/local/Cellar/ruby/2.4.0/lib
-L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -lruby.2.4.0 -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return 0; 6: } /* end */
"clang
-I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/x86_64-darwin15 -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -Werror -c conftest.c" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main() {return 0;} /* end */
"clang
-I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/x86_64-darwin15 -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe -Wno-error=unused-command-line-argument-hard-error-in-future -Werror -c conftest.c" error: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Werror,-Wunknown-warning-option] checked program was: /* begin */ 1:
#include "ruby.h" 2: 3: int main() {return 0;} /* end */
have_header: checking for iconv.h... -------------------- yes
"clang -E
-I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/x86_64-darwin15 -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -o conftest.i" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include <iconv.h> /* end */
--------------------
have_library: checking for gzdopen() in -lz... -------------------- yes
"clang -o conftest
-I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/x86_64-darwin15 -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/usr/local/Cellar/ruby/2.4.0/lib
-L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -lruby.2.4.0 -lz -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include <zlib.h> 4: 5: /*top*/ 6: extern int t(void); 7: int main(int argc, char **argv) 8: { 9: if (argc > 1000000) { 10: printf("%p", &t); 11: } 12: 13: return 0; 14: } 15: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; } /* end
*/
--------------------
have_iconv?: checking for iconv using --with-opt-* flags...
-------------------- yes
"clang -o conftest
-I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/x86_64-darwin15 -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/usr/local/Cellar/ruby/2.4.0/lib
-L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -lruby.2.4.0 -lpthread -ldl -lobjc " Undefined symbols for architecture x86_64: "_iconv", referenced from:
_main in conftest-d8bec7.o "_iconv_open", referenced from:
_main in conftest-d8bec7.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) checked program was: /* begin */ 1:
#include "ruby.h" 2: 3: #include <stdlib.h> 4: #include <iconv.h> 5: 6: int main(void) 7: { 8: iconv_t cd = iconv_open("", ""); 9: iconv(cd, NULL, NULL, NULL, NULL); 10: return EXIT_SUCCESS; 11: } /* end */
"clang -o conftest
-I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/x86_64-darwin15 -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/backward -I/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/openssl/include -I/usr/local/opt/readline/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/usr/local/Cellar/ruby/2.4.0/lib
-L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib -lruby.2.4.0 -liconv -lpthread -ldl -lobjc " checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include <stdlib.h> 4: #include <iconv.h> 5: 6: int main(void) 7: { 8: iconv_t cd = iconv_open("", ""); 9: iconv(cd, NULL, NULL, NULL, NULL); 10: return EXIT_SUCCESS; 11: } /* end */
--------------------
I feel like I've tried everything- please help!
Try installing nokogiri manually
brew install libxml2 libxslt
gem install nokogiri -v '1.7.1' -- --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2
Have you checked to see if Command Line tools are installed? A lot of times Nokogiri won't install if the there is no c compiler.
type: $ xcode-select -p
If you see: /Applications/Xcode.app/Contents/Developer The full Xcode package is already installed.
type gcc
You should see an alert box:
Alternatively, you can use a command to install Xcode Command Line Tools. It will produce a similar alert box. Note: the double hyphen:
$ xcode-select --install
That might help
I ended up reinstalling everything. It was coming from an issue with make. Resolved here: https://github.com/rvm/rvm/issues/3995

Gem install fails on windows. mkmf.log cannot find -lX11

I am trying to install rmagick gem on for my rails framework.
I have installed imagemagick and set lib and include path in system variables
But when installing gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"' i still get errors.
gem command
C:\sites\redmine> gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"'
gem.bat : ERROR: While executing gem ... (OptionParser::InvalidOption)
At line:1 char:4
+ gem <<<< install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6
.7.9-Q8"'
+ CategoryInfo : NotSpecified: (ERROR: While e...:InvalidOption)
:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
invalid option: --with-opt-dir=c:\RailsInstaller\ImageMagick-6.7.9-Q8
mkmf.log file says
assert_minimum_ruby_version!: checking for Ruby version >= 1.8.5... -------------------- yes
--------------------
"gcc -o conftest.exe -IC:/RailsInstaller/Ruby2.1.0/include/ruby-2.1.0/i386-mingw32 -IC:/RailsInstaller/Ruby2.1.0/include/ruby-2.1.0/ruby/backward -IC:/RailsInstaller/Ruby2.1.0/include/ruby-2.1.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/RailsInstaller/Ruby2.1.0/lib -L. -lCORE_RL_magick_ -lX11 -lmsvcrt-ruby210 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
c:/railsinstaller/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lCORE_RL_magick_
c:/railsinstaller/devkit/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lX11
collect2.exe: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
From log it is clear that devkit is not able to locate ImageMagick
But i have set it PATH = C:\RailsInstaller\ImageMagick-6.7.9-Q8
Have you considered developing with nitrous io? Developing rails in windows is much harder because there are a lot of errors you have to deal with that others don't and there's not a whole lot of documentation/support. Most answers boil down to something like "windows and rails don't mix".

Can't install curb gem in Linux Mint

I have a problem with installing curb. When I type in my console:
sudo gem install curb
It returns me following error:
Fetching: curb-0.8.6.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for curl-config... no
checking for main() in -lcurl... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.9.1
--with-curl-dir
--without-curl-dir
--with-curl-include
--without-curl-include=${curl-dir}/include
--with-curl-lib
--without-curl-lib=${curl-dir}/lib
--with-curllib
--without-curllib
extconf.rb:23:in `<main>': Can't find libcurl or curl/curl.h (RuntimeError)
Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
options to extconf.
Gem files will remain installed in /var/lib/gems/1.9.1/gems/curb-0.8.6 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/curb-0.8.6/ext/gem_make.out
I don't have any idea how to solve this problem. I was looking for some solution in Google but not find anything that will help me to solve this problem. Please help...
EDIT:
Here is mkmf.log file. Maybe it will be helpfull in debuging:
find_executable: checking for curl-config... -------------------- no
--------------------
have_library: checking for main() in -lcurl... -------------------- no
"gcc -o conftest -I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -L/build/buildd/ruby1.9.1-1.9.3.484/debian/lib -rdynamic -Wl,-export-dynamic -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"gcc -o conftest -I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -L/build/buildd/ruby1.9.1-1.9.3.484/debian/lib -rdynamic -Wl,-export-dynamic -lruby-1.9.1 -lcurl -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:53: error: ‘main’ undeclared (first use in this function)
int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
^
conftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:4:28: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
^
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
"gcc -o conftest -I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -L/build/buildd/ruby1.9.1-1.9.3.484/debian/lib -rdynamic -Wl,-export-dynamic -lruby-1.9.1 -lcurl -lpthread -lrt -ldl -lcrypt -lm -lc"
conftest.c: In function ‘t’:
conftest.c:4:1: warning: implicit declaration of function ‘main’ [-Wimplicit-function-declaration]
int t() { main(); return 0; }
^
/usr/bin/ld: cannot find -lcurl
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { main(); return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
--------------------
If you are on Ubuntu do this before proceeding:
sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
Alternatively for other OS install, download package from here after selecting your OS:
http://curl.haxx.se/dlwiz/?type=devel
Your Mint installation is probably missing the curl dev libraries.
Try this on the command line:
sudo apt-get install libcurl4-openssl-dev
Use command from previous answer
sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
Sometimes Mint can't install libcurl4-openssl-dev because of next error.
The following packages have unmet dependencies:
libldap2-dev : Depends: libldap-2.4-2 (= 2.4.31-1+nmu2ubuntu8.2) but 2.4.31-1+nmu2ubuntu8.3 is to be installed
E: Unable to correct problems, you have held broken packages.
In my case I've resolved it with next command:
sudo aptitude install libldap2-dev
At first it suggested to do nothing, I've selected No, then it suggested to downgrade my current install to proper version. I've selected Yes. Then I was able to install libcurl4-openssl-dev as usual

Can't install ActiveSupport for Ruby on Windows

I'm trying to install ActiveSupport on my pc which runs Win 8, but it fails and it gives me a list of things that went wrong.
See screenshot: http://imgur.com/2EP46TT
I installed the DevKit beforehand, in case this matters.
I'm very new to Ruby so I'd really appreciate any help I can get.
This is what was in the mkmf.log
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 -IC:/Ruby200-x64/include/ruby-2.0.0/ruby/backward -IC:/Ruby200-x64/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64 -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -march=native conftest.c -L. -LC:/Ruby200-x64/lib -L. -lx64-msvcrt-ruby200 -lshell32 -lws2_32 -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include
4: #include
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */

Unable to install linecache19 gem

When i do bundle install im getting the following error "An error occurred while installing linecache19 (0.5.11), and Bundler cannot continue". The complete trace is as follows :
Installing linecache19 (0.5.11) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/raza/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb
checking for vm_core.h... no
/home/raza/.rvm/gems/ruby-1.9.3-p362#holla/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config.
checking for vm_core.h... yes
checking for version.h... yes
checking for RUBY_VERSION_MAJOR in version.h... no
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p362.tar.gz
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p362.tar.gz
checking for vm_core.h... yes
checking for version.h... yes
checking for RUBY_VERSION_MAJOR in version.h... no
Makefile creation failed
*************************************************************
NOTE: For Ruby 1.9 installation instructions, please see:
http://wiki.github.com/mark-moseley/ruby-debug
*************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/raza/.rvm/rubies/ruby-1.9.3-p362/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
Gem files will remain installed in /home/raza/.rvm/gems/ruby-1.9.3-p362#holla/gems/linecache19-0.5.11 for inspection.
Results logged to /home/raza/.rvm/gems/ruby-1.9.3-p362#holla/gems/linecache19-0.5.11/ext/trace_nums/gem_make.out
An error occurred while installing linecache19 (0.5.11), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.11'` succeeds before bundling.
I then tried running gem install linecache19 -v '0.5.11' as well as gem install linecache19 -v '0.5.11' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p362 but still facing same problem.
My mkmf.log located at ~/.rvm/gems/ruby-1.9.3-p362#holla/gems/linecache19-0.5.11/ext/trace_nums is as follows :
have_header: checking for vm_core.h... -------------------- no
"gcc -o conftest -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-linux -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/home/raza/.rvm/usr/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/raza/.rvm/rubies/ruby-1.9.3-p362/lib -Wl,-R/home/raza/.rvm/rubies/ruby-1.9.3-p362/lib -L/home/raza/.rvm/usr/lib -Wl,-R/home/raza/.rvm/usr/lib -L. -rdynamic -Wl,-export-dynamic -L/home/raza/.rvm/usr/lib -Wl,-R/home/raza/.rvm/usr/lib -Wl,-R -Wl,/home/raza/.rvm/rubies/ruby-1.9.3-p362/lib -L/home/raza/.rvm/rubies/ruby-1.9.3-p362/lib -lruby -lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
"gcc -E -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-linux -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/home/raza/.rvm/usr/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -o conftest.i"
conftest.c:3:21: fatal error: vm_core.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <vm_core.h>
/* end */
--------------------
have_header: checking for vm_core.h... -------------------- yes
"gcc -E -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-linux -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby-1.9.3-p362 -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <vm_core.h>
/* end */
--------------------
have_header: checking for version.h... -------------------- yes
"gcc -E -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-linux -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby-1.9.3-p362 -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <version.h>
/* end */
--------------------
have_macro: checking for RUBY_VERSION_MAJOR in version.h... -------------------- no
"gcc -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-linux -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby-1.9.3-p362 -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC -c conftest.c"
conftest.c:6:3: error: #error
conftest.c:7:1: error: expected identifier or ‘(’ before ‘>>’ token
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <version.h>
4: /*top*/
5: #ifndef RUBY_VERSION_MAJOR
6: # error
7: >>>>>> RUBY_VERSION_MAJOR undefined <<<<<<
8: #endif
/* end */
--------------------
have_header: checking for vm_core.h... -------------------- yes
"gcc -E -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-linux -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby-1.9.3-p362 -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <vm_core.h>
/* end */
--------------------
have_header: checking for version.h... -------------------- yes
"gcc -E -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-linux -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby-1.9.3-p362 -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <version.h>
/* end */
--------------------
have_macro: checking for RUBY_VERSION_MAJOR in version.h... -------------------- no
"gcc -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-linux -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/home/raza/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby-1.9.3-p362 -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC -c conftest.c"
conftest.c:6:3: error: #error
conftest.c:7:1: error: expected identifier or ‘(’ before ‘>>’ token
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <version.h>
4: /*top*/
5: #ifndef RUBY_VERSION_MAJOR
6: # error
7: >>>>>> RUBY_VERSION_MAJOR undefined <<<<<<
8: #endif
/* end */
--------------------
Im on a machine running Ubuntu 12.10. How can i fix this problem ?
Thank You
You need to install ruby-debug first passing the include directory.
gem install ruby-debug19 --
--with-ruby-include=$rvm_path/src/ruby-1.9.3-p362

Resources