igorkasyanchuk / rails_db

Rails Database Viewer and SQL Query Runner
https://www.railsjazz.com/
MIT License
1.46k stars 111 forks source link

Running railsdb from the command line gives `class_eval': method `search' not defined in Ransack::Adapters::ActiveRecord::Base error #79

Closed fuzzygroup closed 6 years ago

fuzzygroup commented 6 years ago

Hi,

When I add the gem rails_db gem to my gemfile, bundle install and then run railsdb, it errors:

/Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/test/standalone/config/application.rb:10:in `class_eval': method `search' not defined in Ransack::Adapters::ActiveRecord::Base (NameError)
        from (eval):1:in `<top (required)>'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/test/standalone/config/application.rb:10:in `class_eval'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/test/standalone/config/application.rb:10:in `<top (required)>'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/test/standalone/config/environment.rb:2:in `require'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/test/standalone/config/environment.rb:2:in `<top (required)>'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/lib/standalone.rb:19:in `require'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/lib/standalone.rb:19:in `run'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/lib/standalone.rb:50:in `<top (required)>'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/bin/railsdb:3:in `require'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@global/gems/rails_db-1.6.0/bin/railsdb:3:in `<top (required)>'
        from /Users/sjohnson/.rvm/rubies/ruby-2.3.1/bin/railsdb:23:in `load'
        from /Users/sjohnson/.rvm/rubies/ruby-2.3.1/bin/railsdb:23:in `<main>'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@seira_watch_site/bin/ruby_executable_hooks:15:in `eval'
        from /Users/sjohnson/.rvm/gems/ruby-2.3.1@seira_watch_site/bin/ruby_executable_hooks:15:in `<main>'

Rails 5, mysql

I can use runsql:

runsql "select id, email from users"

Executing: select id, email from users +----+----------------------------+ | id | email | +----+----------------------------+ | 16 | demo10@gmail.com | | 18 | demo11@seirawatch.com | | 7 | demo2@seirawatch.com | | 9 | demo3@gmail.com | | 10 | demo4@gmail.com | | 11 | demo5@gmail.com | | 12 | demo6@gmail.com | | 13 | demo7@gmail.com | | 14 | demo8@gmail.com | | 15 | demo9@gmail.com | | 17 | demo@seirawatch.com | | 4 | fuzzygroup+test1@gmail.com | | 5 | fuzzygroup+test2@gmail.com | | 3 | fuzzygroup@gmail.com | | 2 | nickjanetakis+2@gmail.com | +----+----------------------------+

igorkasyanchuk commented 6 years ago

hmm, when this issue hapen? When you run "runsql" ? or what command? Could you please put clear instructions how to reproduce the issue. Thanks

igorkasyanchuk commented 6 years ago

I think now it's fixed