Note that there are some explanatory texts on larger screens.

plurals
  1. PONoMethodError: undefined method `more_results' for #<Mysql>
    primarykey
    data
    text
    <p>I am trying to create rake task to import data from my old php application.But I can not connect to mysql database properly, when I run Old::User.all on rails console ,I get this error :</p> <pre><code>NoMethodError: undefined method `more_results' for #&lt;Mysql&gt; from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:623:in `select' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:56:in `select_all' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/base.rb:467:in `find_by_sql' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/relation.rb:64:in `to_a' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/relation/finder_methods.rb:143:in `all' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/base.rb:439:in `__send__' from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.3/lib/active_record/base.rb:439:in `all' from (irb):1 </code></pre> <p>Model class Old/user.rb</p> <pre><code>class Old::User &lt; ActiveRecord::Base establish_connection "old_database" # Because table name is lowercase def self.table_name() "user" end end </code></pre> <p>database.yml</p> <pre><code>old_database: adapter: mysql database: old_database username: root password: socket: /Applications/MAMP/tmp/mysql/mysql.sock </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload