Installing datamapper mysql dm-mysql-adapter on redhat - mysql

I'm trying to move a small Sinatra app I have going on an Ubuntu box to a redhat box.
While installing gems, I get a "Can't build native extension" error while trying to install the gem dm-mysql-adapter.
I have mysql-devel installed, which I believe is the required library, but it doesn't seem to work.
All the info I can find online is for Ubuntu and says installing libmysqlclient-dev (which doesn't exist for Redhat; again, I believe mysql-devel is the appropriate package).
Any advice for someone using redhat?

you have the correct package "mysql-devel-5.1.48-1" but the gem installs fine on my centos5 box without the package installed, you could try the ruby-mysql gem instead.
[11:13:01][root#HOST:~]# gem search mysql
*** LOCAL GEMS ***
[11:13:03][root#HOST:~]# rpm -qa | grep -i mysql
perl-DBD-MySQL-3.0007-2.el5
mysql-5.0.77-4.el5_5.4
[11:13:11][root#HOST:~]# gem install mysql
Building native extensions. This could take a while...
Successfully installed mysql-2.8.1
1 gem installed
Installing ri documentation for mysql-2.8.1...
...
[11:13:22][root#HOST:~]#

Related

fat free crm installation mysql error

I ma trying to install fat free crm on windows using these instructions http://guides.fatfreecrm.com/Setup-Microsoft-Windows.html
I am on the part where we install mysql2 lib and libmysql.dll
The command "gem install --no-rdoc --no-ri mysql2 -v 0.2.7 -- with-mysql-dir=X: --with-mysql-lib=X:\bin --with-mysql-include=X:\include" fails and error comes "Error installing mysql2:
ERROR: Failed to build gem native extension.".I fixed this part my changing the version of mysql in the command to 0.3.11.Now the last step says to copy libmysql.dll but I cant find that file in the specified directory.
If it's of interest, Bitnami has recently published a one-click installer for FFCRM. See https://bitnami.com/stack/fat-free-crm I'll also update the FFCRM docs to note this.

jruby-lint gem installed but no jrlint available?

I've recently started exploring JRuby using Joe Kutner's book "Deploying with JRuby", but I've hit an issue when trying to install the jruby-lint gem. Below is the output from my attempts, including the version numbers of Java, JRuby, and my OS.
I don't understand the output, especially why nokogiri wouldn't install as a jruby-lint dependency, but would install ok on its own. While the jruby-lint gem is now reported as having installed correctly, it has not delivered a jrlint executable/script to use, and I don't know where to go from here. Any ideas?
C:\Dev\repos\twitalytics>jruby --version
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b11 [Windows 7-amd64]
C:\Dev\repos\twitalytics>jruby -S gem install jruby-lint
Building native extensions. This could take a while...
ERROR: Error installing jruby-lint:
ERROR: Failed to build gem native extension.
C:/Dev/jruby-1.7.3/bin/jruby.exe extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS or modify .jrubyrc to enable.
(root) at C:/Dev/jruby-1.7.3/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1027
(root) at C:/Dev/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:1
(root) at extconf.rb:5
Gem files will remain installed in C:/Users/Owen/.gem/jruby/1.8/gems/nokogiri-1.6.0.rc1 for inspection.
Results logged to C:/Users/Owen/.gem/jruby/1.8/gems/nokogiri-1.6.0.rc1/ext/nokogiri/gem_make.out
C:\Dev\repos\twitalytics>set JRUBY_OPTS=--1.8
C:\Dev\jruby-1.7.3>jruby --version
jruby 1.7.3 (ruby-1.8.7p370) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_21-b11 [Windows 7-amd64]
C:\Dev\repos\twitalytics>jruby -S gem install jruby-lint
ERROR: Error installing jruby-lint:
nokogiri requires Ruby version >= 1.9.2.
C:\Dev\repos\twitalytics>jruby -S gem install nokogiri
Fetching: nokogiri-1.5.9-java.gem (100%)
Successfully installed nokogiri-1.5.9-java
1 gem installed
C:\Dev\repos\twitalytics>jruby -S gem install jruby-lint
Fetching: jruby-lint-0.4.1.gem (100%)
Successfully installed jruby-lint-0.4.1
1 gem installed
C:\Dev\repos\twitalytics>jrlint
'jrlint' is not recognized as an internal or external command,
operable program or batch file.
I ran into a very similar issue, also while working through this book. Updating Rubygems solved it for me. Perhaps try:
jruby -S gem update --system
It's interesting that it tries to install the Ruby(not JRuby) version of Nokogiri cause it tries to install C extensions.
I think if you install the same version required by jruby-lint which is nokogiri-1.6.0.rc1, problem will be solved.
Neither solution here works for me on Windows. jruby -S gem install nokogiri
installs nokogiri-1.6.0-java
If I download the gem from https://github.com/jruby/jruby-lint and build it myself it leaves the gem folder empty at jruby\lib\ruby\gems\shared\gems\jruby-lint-0.4.1
And it won't make a bat file for running it in the /bin dir. I don't think this gem is ready for windows. Could it be that I'm trying to install it on BitNami stack? I haven't tried it with a regular install of JRuby.
In case updating Rubygems doesn't work, try:
gem install nokogiri
This will install nokogiri-1.6.0-java
then again:
gem install jruby-lint
and you're good to go.

Finally installed MySQL for Rails in Windows 64 bit, and now

Environment:
Windows 7 64bit (Home Premium)
Ruby 1.9.2 p290 (2011-07-09) [i386-mingw32]
Rails 3.0.10
MySQL 5.5
Ruby, despite my having successfully installed the mysql2 rubygem thinks that the gem is missing when I invoke a rails command that requires it.
After having spent the evening getting the mysql rubygem installed on Windows 64 bit, I decided to (finally) get cracking on linking mysql to a local rails server. This is how I was trying to do it...
(Fairly) Exact transcript from cmd.exe
C:\rails\cookbook>gem install mysql --platform=ruby -- --with-mysql-include=c:\mysql\include --with-mysql-lib=c:\mysql\lib
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed mysql-2.8.1
1 gem installed
Installing ri documentation for mysql-2.8.1...
Installing RDoc documentation for mysql-2.8.1...
(I thought this was successful mysql install, should I test it somehow?)
C:\>gem install mysql2 --platform=ruby -- --with-mysql-include=c:\mysql\include --with-mysql-lib=c:\mysql\lib
Fetching: mysql2-0.3.7.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed mysql2-0.3.7
1 gem installed
Installing ri documentation for mysql2-0.3.7...
Enclosing class/module 'mMysql2' for class Client not known
Installing RDoc documentation for mysql2-0.3.7...
Enclosing class/module 'mMysql2' for class Client not known
(Same as above - I thought this was successful mysql install)
C:\rails>rails new cookbook -d mysql
(successfully creates directories for project in c:\rails\cookbook)
C:\rails\cookbook>rails server
?[31mCould not find gem 'mysql2 (~> 0.2.11)' in any of the gem sources listed in your Gemfile.?[0m
?[33mRun `bundle install` to install missing gems.?[0m
Notes:
I noticed it wants rubygem mysql2-0.2.11, I have 0.3.7. I tried installing 0.2.11 specifically by the method I used to install the two gems above. No dice, it couldn't find a gem by the name mysql2-0.2.11 in 'any repository'
I'm stumped, any thoughts fellas (and gals)?
I believe your MySQL installation is a 64bits (like Windows), correct?
Ruby is 32bits, so you cannot link 32bits against 64bits.
I've posted a article covering the installation steps on my blog:
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
These steps use MySQL Connector/C to workaround the 32bits versus 64bits issues.
Both mysql or mysql2 gem should work with this.
Have you included mysql2 in your Gemfile and subsequently executed bundle install ?
## my sql installation (on 64 bit architecture)
download connector (download zip file and extract it to c drive)
http://dev.mysql.com/downloads/connector/c/
download mysql
http://dev.mysql.com/downloads/installer/5.6.html
command to install mysql with connector
C:\Sites\rails_project\resume>gem install mysql --platform=ruby -- --with-mysql-
dir=C:/mysql-connector-c-6.1.0-win32
After this copy libmysql.dll from connector folder and paste it to ruby>bin folder

How to install gem MySQL on Mac OS 10.6.6

Ruby already installed on Mac. So i just installed rails.
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
rails 2.3.11
gem 1.3.5
When i trying : gem install mysql i get this error:
89-235-235-64:~ vitali$ gem install mysql
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have /Users/vitali/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Users/vitali/.gem/ruby/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Users/vitali/.gem/ruby/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
89-235-235-64:~ vitali$
Dont understand what to do. gem install mysql installing without MySQl itself or I should download and install MySQL as prorgamm? If yes, from what resource, what version, how to instal? Please help me, im newbie on mac. Big thanks!
You're almost certainly going to need MySQL installed to have the MySQL gem installed (even better is the mysql2 gem, which Rails also works with - just use mysql2 instead of mysql in your database.yml file).
I find the best way to get MySQL on my Mac whenever I format it (which, admittedly, is rarely) is to use Homebrew. So, if you don't have Homebrew installed, I'd start with that... and once that's done, it should be a matter of running sudo brew install mysql, and running the instructions it provides after the installation is done.

error when installing mysql ruby gem on OSX 10.6.3

So I am getting the same issue as mentioned here -
gem install mysql failure in Snow Leopard
But I haven't been able to get it fixed using the answers on this link.
Here's a brief history -
I had MAMP on my machine,
but now I downloaded the latest MySQL from mysql.com and installed version 5.1.46
this new version runs fine and client "mysql" is able to connect
and I also have XCode v3.2.1, since someone mentioned that it can cause issues.
Here's the error -
**Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out**
"can't find header files for ruby" usually means that the system can't locate the header files for Ruby. This happened to me when I upgraded to 10.6 from 10.5. Download the latest XCode from Apple's site and reinstall it. Make sure that you check the box for "UNIX Development" during the install. The header files for Ruby are not in the main package.
Have you installed other versions of Ruby or are you using the standard 1.8.7 that comes with OS X? You can check your version of ruby by typing ruby -v at a terminal prompt.