{"id":6876,"date":"2014-05-08T00:28:24","date_gmt":"2014-05-08T00:28:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/08\/problem-about-mysql2-collection-of-common-programming-errors-2\/"},"modified":"2014-05-08T00:28:24","modified_gmt":"2014-05-08T00:28:24","slug":"problem-about-mysql2-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/08\/problem-about-mysql2-collection-of-common-programming-errors-2\/","title":{"rendered":"problem about mysql2-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/38db5fed89a6dc493f60d57c90e56fd1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPrussian<br \/>\nmysql ruby-on-rails rvm mysql2 psychparser<br \/>\nWhile I am new to RoR I feel like I have done everything possible to get this done namely:Downloaded &amp; Installed MySQL Updated OSX Updaded XCode Installed RVM Installed Homebrew Gems seem to be up to date SQLite doesnt gives me any problems when trying to do rails generatehowever when I do rails generate inside my application that is supposed to use MySQL, this is what I get$ rails generate\/Users\/localuser\/.rvm\/rubies\/ruby-1.9.2-p320\/lib\/ruby\/1.9.1\/psych.rb:148:in `parse&#8217;: couldn&#8217;t parse YAM<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0ae66820f7ce27d139c75032f297390f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDrew<br \/>\nruby-on-rails ruby ruby-on-rails-3 rubygems mysql2<br \/>\nWhy would this method (list_id) be undefined when I have the adapter installed?== XXXXX: migrating ========================================&#8211; create_table(:XXXX)&#8211; list_id()rake aborted!An error has occurred, all later migrations canceled:undefined method `list_id&#8217; for #&lt;ActiveRecord::ConnectionAdapters::Mysql2Adapter:0x007f8345fc0f10&gt;\/Users\/dcarpenter\/Dropbox\/workspace\/gems\/activerecord-3.0.9\/lib\/active_record\/migration.rb:385:in `block in method_missing&#8217;HERE&#8217;S THE FULL LOAD:undefined me<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/psFAI.jpg?s=32&amp;g=1\" \/><br \/>\nLinus Caldwell<br \/>\nruby-on-rails rake mysql2 dbmigrate<br \/>\nI&#8217;m new of rails, and i have this big problem. I&#8217;m running rails 3.2.9 and Ruby 1.9.3, I did a porting of a rails app from linux to windows, but in windows i&#8217;m having a lot of problems with mysql2 gem. I installed mysql2 gem yesterday and than i tried to run rake db:migrate but i have this output:rake aborted!Please install the mysql2 adapter: gem install activerecord-mysql2-adapter (cannot load such file &#8212; mysql2)C:\/Users\/RoccaA\/Desktop\/project\/config\/environment.rb:5:in `&#8217;Tasks: TOP =&gt; db:mig<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e6a8c04594efffbb1da3de2f263f0060?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nj\u00e4vi<br \/>\nruby-on-rails gem mysql2<br \/>\nI&#8217;m trying to set up my RubyOnRails development enviroment with MySQL. I have XAMPP installed, so I decided to use the XAMPP&#8217;s MySQL installation, (therefore I installed the XAMPP dev package).Now I&#8217;m trying to install the mysql2 gem but I got this error:gem install mysql2 &#8211;version 0.2.7 &#8212; &#8211;with-mysql-dir=\/Applications\/XAMPP\/xamppfiles\/ &#8211;with-mysql-lib=\/Applications\/XAMPP\/xamppfiles\/lib\/mysql\/ -with-mysql-include=\/Applications\/XAMPP\/xamppfiles\/include\/mysql\/ &#8211;with-mysql-config=\/Applications<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bb6f9ef4e70a3c2aa4b1c0fa6d614e4e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMrk Fldig<br \/>\nruby gem mysql2<br \/>\nI&#8217;m trying to installing the mysql2 gem on windows 7 I downloaded the connector from the mysql site and placed the libmysql.dll in ruby200\\binthen do gem install mysql2These are the results am I being dim here?Temporarily enhancing PATH to include DevKit&#8230; Building native extensions. This could take a while&#8230; ERROR: Error installing mysql2:ERROR: Failed to build gem native extension.C:\/Ruby200\/bin\/ruby.exe extconf.rb checking for rb_thread_blocking_region()&#8230; yes checking for rb_wait_for_si<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5b51732df1273cc8d770b04dcd9bb712?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nweb spider26<br \/>\nruby-on-rails-3 sunspot mysql2 sunspot-rails<br \/>\nPlease any one tell me is it possible put conditions on the associated fields using sunspot solr. I have four models. That is brands, departments, categories and product_details. brands table contains id, name and verified (flag). departments contains id, name. categories contains id and name. product_details contains name, price, image_url, discount, brand_id, department id and category_id. brand.rbclass Brand &lt; ActiveRecord::Basehas_many :product_details, :dependent=&gt;:destroy enddepartme<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/eG69F.jpg?s=32&amp;g=1\" \/><br \/>\nFabien Lebas<br \/>\nmysql ruby-on-rails-3 heroku amazon-ec2 mysql2<br \/>\nI&#8217;m installed the Amazon RDS Add-on in Heroku, and created OK an instance in Amazon AWS. But I can&#8217;t run heroku run rake db:migrateIt&#8217;s ending with (&#8230;) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:migrate rake aborted! undefined method `accept&#8217; for nil:NilClass \/app\/vendor\/bundle\/ruby\/1.9.1\/gems\/activerecord- 3.2.11\/lib\/active_record\/connection_adapters\/abstract\/datab<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1074f0a031cca12280359231a87662af?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEric<br \/>\nruby gem mysql2<br \/>\nWhile trying to build the mysql2 gem with ruby 1.9.2-p320 on Fedora 16, I ran into this error, reproducible like so:gremlin:mysql2 $ cat conftest.c#include &#8220;ruby.h&#8221;\/*top*\/int main() {return 0;}int t() {void ((*volatile p)());p = (void ((*)()))rb_thread_blocking_region;return 0;}gremlin:mysql2 $ gcc -o conftest -I\/usr\/local\/include\/ruby-1.9.1\/i686-linux \\-I\/usr\/local\/include\/ruby-1.9.1\/ruby\/backward -I\/usr\/local\/include\/ruby-1.9.1 -I. -I\/usr\/local\/include\/ruby-1.9.1\/ -D_FILE_OFFSET_BITS=64 -O3<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/67ddb32384a4b119e289644190aadad3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCaio Tarifa<br \/>\nmysql ruby-on-rails activerecord amazon-web-services mysql2<br \/>\nI have a RubyOnRails application hosted on an Amazon EC2 server (with Elastic Load Balancer) that communicates with the database hosted on Amazon RDS.I&#8217;m having trouble to fix the error 500 returned by the aplication sporadically:NoMethodError (undefined method `fields&#8217; for nil:NilClass):activerecord (3.2.8) lib\/active_record\/connection_adapters\/mysql2_adapter.rb:216:in `exec_query&#8217;How can I fix this error?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ab65b7140835a42d94115fa78b2c21ec?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHard-Boiled Wonderland<br \/>\nrubygems installation mysql2<br \/>\nI am struggling to install mysql2 gem 0.2.7, this is the output I get:C:\/RailsInstaller\/Ruby192\/bin\/ruby.exe extconf.rb &#8211;with-mysql-dir=X: &#8211;with-mysql-lib=X:\\lib &#8211;no-rdoc &#8211;no-ri checking for rb_thread_blocking_region()&#8230; yes checking for main() in -llibmysql&#8230; yes checking for mysql.h&#8230; yes checking for errmsg.h&#8230; yes checking for mysqld_error.h&#8230; yes creating Makefilemake gcc -I. -IC:\/RailsInstaller\/Ruby192\/include\/ruby-1.9.1\/i386-mingw32 -I\/C\/RailsInstaller\/Ruby192\/include\/ruby-1.9.1\/<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6df8b5f2a2312628ad92f50b7945dd9f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMichiel de Mare<br \/>\nruby-on-rails rubygems bundler mysql2<br \/>\nI recently upgraded mysql on my machine. As a result I&#8217;m attempting to update my mysql2 gem accordingly. In the process of doing that, I run &#8220;bundle install&#8221;, and for some reason all of the gems in my Gemfile are getting installed in a .\/mysql2 directory?? ruby-1.9.2-p180 [dev]:project.git$ bundle install NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. Gem.source_index called from \/Users\/al\/.rvm\/gems\/ruby-1.9.2-p180\/gems\/bundler-1.0.10\/lib\/bund<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f46301bba7817f6098df3b0a0ace139b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBrady<br \/>\nruby-on-rails-3 activerecord mysql2<br \/>\nI&#8217;m using Active Admin as my interface for a rails project (client&#8217;s request). The problem is&#8230; most of the tables in my client&#8217;s database have primary key fields named &#8216;something_id&#8217; instead of plain &#8216;id&#8217;. This poses a big problem as Active Admin looks for an &#8216;id&#8217; field and, since it doesn&#8217;t find one, it basically crashes the page with an error:Mysql2::Error: Unknown column &#8216;buzz_articles.id&#8217; in &#8216;order clause&#8217;: SELECT `buzz_articles`.* FROM `buzz_articles` ORDER BY buzz_articles.id desc LIMIT<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9e9e85a1cd09a7004955b0f60162bdf3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nshishirmk<br \/>\nruby-on-rails ruby-on-rails-3.2 innodb mysql2<br \/>\nMysql2::Error: Unknown table engine &#8216;InnoDB&#8217;: SHOW FULL FIELDS FROM schema_migrationsThis is the error I see when i run rake db:migrate. I am using mysql server 5.1 and rails 3.2.7Please help me solve this problem<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bedaeefbbe27cf163cf294c2ab332977?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nvosmith<br \/>\nactiverecord ruby-on-rails-3.2 mysql2<br \/>\nI&#8217;m trying to destroy an object using a call similar to MyObject.destroy_all({:user_id =&gt; current_user.id, :item_type_id =&gt; params[:type_id], :item_id =&gt; params[:item_id]})Rails generates this as a SQL commands:User Load (0.5ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1 MyObject Load (0.2ms) SELECT `my_objects`.* FROM `my_objects` WHERE `my_objects`.`user_id` = 1 AND `my_objects`.`item_type_id` = 3 AND `my_objects`.`item_id` = 9 (0.1ms) BEGIN SQL (0.4ms) DELETE F<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f080a83364d176b8eb3c4009ee3b7bab?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ntendril89<br \/>\nruby-on-rails ubuntu gem mysql2<br \/>\nI&#8217;m a Ror newbe and I&#8217;m attempting to create my first webapp with rails. I&#8217;m encountering a problem when I installed gem mysql2: This is my actual configuration:ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]rails -v: Rails 3.2.3gem -v: 1.8.24michele@michele:~\/rails\/my_app$ gem install mysql2 Building native extensions. This could take a while&#8230; Successfully installed mysql2-0.3.11 1 gem installed Installing ri documentation for mysql2-0.3.11&#8230; Installing RDoc documentatio<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0ba9efd64f451323efb01c37ce250e0a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDrew White<br \/>\nmysql ruby-on-rails mysql2 navicat<br \/>\nI am trying to create a mysql database with navicat but when i try to link to it it gives me an error in:&#8217;connect&#8217;: Unknown database &#8216;hello&#8217; (Mysql2::Error)(see image)Or when i search for existing databases in terminal (see image ) they do not all show up. Not sure where i am making a mistake?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dcbdba3c4c47c91ec3cab4e6846002f6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsv.luo<br \/>\nruby-on-rails mysql2<br \/>\ni install ror on windows7 with railsintaller2.1.0.ext, and i install mysql2 gem successful, but when run: rake DB:create , get error:&lt;&gt;:couldn&#8217;t parse yaml at line 0 column 0. someone help me !<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0c2f75ef598d989d6b947439b151931a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndaiikota<br \/>\nruby activerecord has-many-through mysql2<br \/>\nI ran into a little problem I have a has_many through relationship here is the code for the modelsclass User &lt; ActiveRecord::Basehas_many :friendshipshas_many :followings, :through =&gt; :friendships, :foreign_key =&gt; &#8220;followed_id&#8221; endclass Friendship &lt; ActiveRecord::Basebelongs_to :user belongs_to :following, :class_name =&gt; &#8220;User&#8221;, :foreign_key =&gt; &#8220;followed_id&#8221; endnow at the console I can type u = User.first and then u.friendships.first.following this gives me the first user u is<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/51bbf006002450d264a53bf1afc428a6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJeremy<br \/>\nrake mysql2<br \/>\nI&#8217;m following instructions from a hand-over package from a previous group. I don&#8217;t know too much about rails or mysql2. I am on Windows.When I do:rake db:migrate RAILS_ENV=productionThis is the output:C:\\jcccf-goslowserver-e30bf00&gt;rake db:migrate RAILS_ENV=production (in C:\/jcccf-goslowserver-e30bf00) rake aborted! Unknown database &#8216;goslow_production&#8217; C:\/Ruby192\/lib\/ruby\/gems\/1.9.1\/gems\/mysql2-0.2.6-x86-mingw32\/lib\/mysql2\/client.r b:37:in `connect&#8217; C:\/Ruby192\/lib\/ruby\/gems\/1.9.1\/gems\/mysql2-0<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n<p>I discovery a place to host code\u3001demo\u3001 blog and websites.<br \/>\nSite access is fast but not money<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.m5zn.com\/newuploads\/2014\/01\/30\/jpg\/e7da807964b1fff.jpg\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prussian mysql ruby-on-rails rvm mysql2 psychparser While I am new to RoR I feel like I have done everything possible to get this done namely:Downloaded &amp; Installed MySQL Updated OSX Updaded XCode Installed RVM Installed Homebrew Gems seem to be up to date SQLite doesnt gives me any problems when trying to do rails generatehowever [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6876","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6876"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6876\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}