Tag: mysql

“193: %1 is not a valid Win32 application” bug with a new Rails Application

I have a new rails application which I have created under Windows 7 by going into a directory and typing “rails newapp”. The creation went fine, and when I access the root page, all is well. However, when I try to access a page that would access the database, I get this: 193: %1 is […]

ERROR: Error installing mysql: ERROR: Failed to build gem native extension

I am a beginner in ruby. when I install MySQL in gem,I got a problem which confused me a long time. I install MySQL from brew, as you know the computer system is OSX 10.10. I have try all solution that can found in stackoverflow,but can’t solve it. such as: 1. Install xcode-tool 2. GEM […]

How do I fix the following? Image not found. Whilst trying to using MySQL in rails

So I think i originally installed rubygems using macports and now that I have updated it without using macports I get the following errors whilst trying to use MySQL. rails s Reason: image not found – /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle Click the link below for the full output: https://skitch.com/stevancw/ri8qa/terminal-bash-bash-94×23 Does anyone know how to fix this or what […]

Accidentally installed mysql twice

First with the typical .DMG installation, and the second with the Brew. I was getting a .sock error with the Brew installation, so I uninstalled it with brew uninstall mysql And now when I try to use the original mysql I get this uninitialized constant MysqlCompat::MysqlRes Yikes. I completely removed mysql and anything related to […]

Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. (Ubuntu Server)

I am deploying my ruby on rails application to DigitalOcean Ubuntu server. But I got this Gem::LoadError: Specified ‘mysql2’ for database adapter, but the gem is not loaded. error. Here is the full error: Here is my Gemfile.lock: GEM remote: https://rubygems.org/ specs: actionmailer (4.2.3) actionpack (= 4.2.3) actionview (= 4.2.3) activejob (= 4.2.3) mail (~> […]

rake aborted! closed stream after upgrading to Snow Leopard

I just upgraded my Leopard system to Snow. I had a Rails application with a suite of Spec examples running before the upgrade; it used a mysql database. After the upgrade, running rake spec would fail like this: … ** Invoke db:schema:load (first_time) ** Invoke environment ** Execute db:schema:load rake aborted! closed stream /opt/local/lib/ruby/1.8/mysql.rb:1032:in `sync=’ […]

Ruby mysql2 extensions built against wrong files location

I have a directory /tmp/buld_source, where I built MySQL 5.5 using cmake with the correct install prefix Then I manually copied libmysql to the correct (I hope) location under the prefix specified. Proper include files were copied as well. After that I built mysql2 gem, providing the path to mysql_config For some reason the gem […]

Broken query using MySQL module with Ruby?

Any idea what is broken about my query here? irb(main):010:0> dbh.query(‘SELECT foo FROM bar’) Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘”‘ at line 1 from (irb):10:in `query’ from (irb):10 from /usr/bin/irb1.9:12:in `<main>’ the table bar […]

jruby jdbcmysql adapter does not work with ssl?

I cannot seem to get jdbcmysql to run over ssl. Downloaded gems: jdbc-mysql (5.0.4) jruby-openssl (0.7.1) Using a normal rails console (not jruby), I got it to run with (sanitized below): cp = ActiveRecord::Base.establish_connection( :adapter => ‘jdbcmysql’, :host => ‘host’, :username => ‘user’, :password => ‘pw’, :database => ‘db’, :sslca => “ca-cert.pem” ) but the […]

Ruby on Rails: MySql Gem does not work: uninitialized constant Mysql::Error

I have the following installed: Mac Os 10.7.2 (MacPro Pro, Processor Core i7) rails 3.1.0 ruby 1.9.2 mysql 5.5.19, for osx10.6 (i386) I can install the mysql gem without problems: sudo env ARCHFLAGS=”-arch x86_64″ gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config I can also login and create a database and a dummy table. But when I want […]

Ruby is the best programming language in the world - Ruby on Rails.