Description
Hello 👋
I have encountered an issue when setting up Middleman to run through Rack. Specifically these instructions on the "Start New Site" page:
you can add a config.ru file at the root of your project with the following contents:
require 'middleman/rack' run Middleman.server
This didn't work for me with the following command: bundle exec rackup config.ru
. I get the following error:
config.ru:2:in `block in <main>': undefined method `server' for Middleman:Module (NoMethodError)
After looking through the code in Middleman:Rack, I've come up with the following which works:
require 'middleman-core/rack'
require 'middleman-autoprefixer'
run Middleman::Rack.new(Middleman::Application.new)
I have to require middleman-autoprefixer
, otherwise I get the following error when running the command above:
Unknown Extension: autoprefixer. Check the name and make sure you have referenced the extension's gem in your Gemfile. (RuntimeError)
I appreciate this is not really a scenario that should be used to run Middleman, as the instructions say. I am not sure whether the instructions are obsolete, or if something I'm doing wrong, but I hope all the above can help!
Activity