nonsequitur / inf-ruby

218 stars 69 forks source link

rails console -e not compatible with rails 3 #120

Closed BlindingDark closed 5 years ago

BlindingDark commented 5 years ago

See https://github.com/nonsequitur/inf-ruby/commit/5531aaeb89602e04ecf749a20d9126fb0a673ac3

Error!

rails/commands/console.rb:23:in `block in start': invalid option: -e (OptionParser::InvalidOption)

recommend workaround: Update your Rails 🤣

temporary solution:

(advice-add
   'inf-ruby-console-rails
   :override
   (lambda (dir)
     (interactive (list (inf-ruby-console-read-directory 'rails)))
     (let* ((default-directory (file-name-as-directory dir))
            (env (inf-ruby-console-rails-env))
            (with-bundler (file-exists-p "Gemfile")))
       (inf-ruby-console-run
        (concat (when with-bundler "bundle exec ")
                "rails console "
                env)
        "rails"))))
dgutov commented 5 years ago

Should be compatible with Rails 4, see https://github.com/nonsequitur/inf-ruby/pull/119.