I'm trying to set up rails for the first time. I've got the app made, I've been following lots of guides.
When I try to install the mysql gem gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.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=/usr/bin/ruby
--with-mysql-config
--without-mysql-config
Looking around on SO and Google, people say to do:
gem install mysql --with-mysql-config=/usr/bin/mysql_config
but I get:
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --with-mysql-config=/usr/bin/mysql_config
Any ideas on how I can get this to work?
If you haven't already you'll need to install the MySQL development library as root:
yum install mysql-devel
Then in the gem install command you need to have another -- in the command line before the --with-mysql-config option:
gem install mysql -- --with-mysql-config=/usr/bin/mysql_config
Related
I was trying to install clamav gem for a project on windows using ruby on rails.
I used gem install clamav -v '0.4.1'
I keep getting this error:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing clamav:
ERROR: Failed to build gem native extension.
c:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
checking for clamav.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:/RailsInstaller/Ruby2.0.0/bin/ruby
--with-clamav-dir
--without-clamav-dir
--with-clamav-include
--without-clamav-include=${clamav-dir}/include
--with-clamav-lib
--without-clamav-lib=${clamav-dir}/
Gem files will remain installed in c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/clamav-0.4.1 for inspection.
Results logged to c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/clamav-0.4.1/ext/clamav/gem_make.out
I know that there isnt a clamav.h file in the folder for gems in RailsInstaller but it updates from rubygems.org so I cannot change it.
On ubuntu you can install libclamav-dev with following command:
sudo apt-get install libclamav-dev
Welcome, gather around.
My first step when trying to install the gem puma is to enter gem install puma --version 2.12.3 into my command prompt. Then this error appears. I don't know what to make of it.
C:\Users>gem install puma --version 2.12.3
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150809-8352-14jkju1.rb extconf.rb
checking for BIO_read() in -lcrypto... no
checking for BIO_read() in -llibeay32... 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:/Ruby22-x64/bin/$(RUBY_BASE_NAME)
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-cryptolib
--without-cryptolib
--with-libeay32lib
--without-libeay32lib
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/puma-2
.12.3 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0
/puma-2.12.3/gem_make.out
Please help, thank you!
You probably just need OpenSSL, but be warned that some gems just fail to work on Windows.
https://github.com/hicknhack-software/rails-disco/wiki/Installing-puma-on-windows
I installed libv8 gem seperately without a hitch, but when I try to install therubyracer gem I get the following error:
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for main() in -lpthread... yes
Warning! Unable to load libv8 ~> 3.16.14.
*** 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}/
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-pthreadlib
--without-pthreadlib
--enable-debug
--disable-debug
extconf.rb:32:in `<main>': undefined method `configure_makefile' for Libv8:Module (NoMethodError)
Gem files will remain installed in /home/thecodehitman/ruby/gems/gems/therubyracer-0.12.1 for inspection.
Results logged to /home/thecodehitman/ruby/gems/gems/therubyracer-0.12.1/ext/v8/gem_make.out
Not sure what to do.
Try this:
$ sudo gem install therubyracer --platform ruby
Try with or without sudo.
If it is a Ruby on Rails app, include the line:
gem 'therubyracer', :platform=>:ruby
inside Gemfile.
I downloaded xcode, command line tools, home brew, rvm, and ruby, but when I use the command sudo gem install rails I get an error message. Not sure what to do any help would be great, I want to install rails on my new mac.
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Users/cheatermoves/.rvm/gems/ruby-2.0.0-p247/gems/atomic-1.1.14/test/test_atomic.rb
marshalls-MacBook-Air:~ cheatermoves$ sudo gem install rails
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
*** 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=/Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
/Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from /Users/cheatermoves/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/mkmf.rb:817:in `try_run'
from extconf.rb:26:in `<main>'
You probably don't want to be using sudo with RVM... Try just:
gem install rails
sudo gcc --version
When you have done this accept user agreement from xcode! (this is what fixed it for me.)
I am not getting error while installing gem ruby-odbc -v'0.99995'.
Please help me to solve this error. I try lot of things but it didn't worked.
Building native extensions. This could take a while...
ERROR: Error installing ruby-odbc:
ERROR: Failed to build gem native extension.
/home/sheetal/.rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb
checking for version.h... yes
checking for sql.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=/home/sheetal/.rvm/rubies/ruby-1.8.7-p371/bin/ruby
--with-odbc-dir
--without-odbc-dir
--with-odbc-include
--without-odbc-include=${odbc-dir}/include
--with-odbc-lib
--without-odbc-lib=${odbc-dir}/lib
ERROR: sql.h not found
I am using ruby 1.8.7 & rails2
Have you tried installing the unix odbc development files?
sudo apt-get install unixodbc-dev
If you're on OS X and having this issue try
brew install unixodbc
Then you should be able to
gem install ruby-odbc