What is the difference between the rails console and the console console?

Can someone explain to me or give me a resource where I can find out the differences between rails consoles and a console console? Is there a way to download all gems automatically to irb instead of the required gem?

+3


source to share


1 answer


Here's a good explanation: What is the difference between the irb

, bundle exec irb

, bundle console

and rails console

?



irb is the main Ruby console. It ignores your Gemfile, and only the core Ruby classes are available without requiring them. It's easy to load planes that Bundler installs outside of the RubyGems load path.

bundle exec irb is like irb if you also need the / setup package. You can only require gems that are in your Gemfile.lock, but you can load those gems no matter where Bundler placed them.

the bundle console is like bundle exec irb if you also called Bundler.require. All gems in your Gemfile, except those marked with require: false, can be used unnecessarily. This is really handy when you are writing your own gems or working with non-Rails code.

the rails console is like launching the console console inside a Rails application if you also need config / environment.rb. You can play with everything with your Rails app running, autoloading and database connections, and everything connected as you'd expect. If you are working in a Rails application, this is the most useful console view.

+11


source







All Articles