rqfeug
Last Updated: October 27, 2016
·
7.892K
· mriddle
A9bc4b096d30752506ea4edac12ada93

Rails console equivalent for Sinatra

If you want to fire up your app and play around via the command line the easiest way I found is to use irb.

Just run with irb with -r. The bundle exec is optional.

bundle exec irb -r app.rb
Say Thanks
Respond

3 Responses
Add your response

5938
2d63741c66663e0f8d59b012ca17cdc3

if you don't mind another dependency, you can add racksh to your gemfile. I've found it extremely useful and it allows you to use a .rackshrc file for configuration.

over 1 year ago ·
5939
A9bc4b096d30752506ea4edac12ada93

Thanks for the tip Kormie!

over 1 year ago ·
23387
Ecfe48fba86dbee29f54ad6a7f8aaaa3

If the command can't find your app.rb file, make sure it's in your LOAD_PATH:

bundle exec irb -I. -r app.rb

over 1 year ago ·