Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.ru instructions do not seem to work #794

Open
rafaelgonzalez opened this issue Dec 30, 2018 · 4 comments
Open

config.ru instructions do not seem to work #794

rafaelgonzalez opened this issue Dec 30, 2018 · 4 comments

Comments

@rafaelgonzalez
Copy link

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!

@tdreyno
Copy link
Member

tdreyno commented Dec 31, 2018

Hi, which version of Middleman are you running? Can you also share the pieces of your Gemfile which specify Middleman?

This should work... its just so rarely used that a regression may have snuck in.

@rafaelgonzalez
Copy link
Author

rafaelgonzalez commented Jan 1, 2019

Hey @tdreyno, thanks for your reply. Here's the Gemfile bit that specifies Middleman:

gem 'middleman', '~> 4.2'
gem 'middleman-autoprefixer', '~> 2.7'
gem 'tzinfo-data', platforms: %i[mswin mingw jruby]
gem 'wdm', '~> 0.1', platforms: %i[mswin mingw]

I've essentially retained whatever middleman init generated and added back my other dependencies in.

@tdreyno
Copy link
Member

tdreyno commented Jan 1, 2019

  1. It definitely appears the server helper method has gone missing.

  2. How are you starting the Rack server? Having to manually require autoprefixer makes me think bundle isn't in play.

I've restored the old api (middleman/middleman@e85bc85), and will get that out VERY SOON (waiting for bundler v2 to do a new release).

@rafaelgonzalez
Copy link
Author

rafaelgonzalez commented Jan 5, 2019

  1. Phew so I wasn't going mad! 😅

  2. I'm transitioning an app to Middleman. It's a very simple Sinatra app booted up with Rack that does not need to be dynamic anymore. But because the current stack uses Rack, I would like to still be able to boot it up that way until the Sinatra->Middleman transition is complete (e.g. how the views are built from JSON data). This is only to make the transition smoother, eventually Rack will be scraped entirely. So yeah, pretty marginal case.

I've restored the old api (middleman/middleman@e85bc85), and will get that out VERY SOON (waiting for bundler v2 to do a new release).

Thanks! No rush from my end.

ghost pushed a commit to rubygems/bundler-site that referenced this issue Jan 15, 2019
439: Bump middleman from 4.2.1 to 4.3.1 r=segiddins a=dependabot[bot]

Bumps [middleman](https://github.com/middleman/middleman) from 4.2.1 to 4.3.1.
<details>
<summary>Changelog</summary>

*Sourced from [middleman's changelog](https://github.com/middleman/middleman/blob/v4.3.1/CHANGELOG.md).*

> # 4.3.1
> 
> * Fix sassc imports of gem files that expect old sass to be present.
> 
> # 4.3.0
> 
> * Only SassC from now on.
> * Fix regression (all the way back to v3) for Integer/Date keys in YAML. [#2238](https://github-redirect.dependabot.com/middleman/middleman/issues/2238)
> * Fix API to allow rack server according to docs (middleman/middlemanapp.com#794)
> * Require i18n ~> 0.8.0 to handle 0.7.0 security issue.
> * Allow Bundler 2
</details>
<details>
<summary>Commits</summary>

- [`4e078b3`](middleman/middleman@4e078b3) Fix tests
- [`8446772`](middleman/middleman@8446772) Bump gemfile
- [`cadcfed`](middleman/middleman@cadcfed) Prep 4.3.1
- [`2802534`](middleman/middleman@2802534) Import paths from libraries which expect ::Sass module to still exist. Fixes ...
- [`7064872`](middleman/middleman@7064872) Test Ruby 2.6.0
- [`defd945`](middleman/middleman@defd945) Use bundler 1.x for Travis
- [`102247a`](middleman/middleman@102247a) Bump minor version
- [`f68f6d3`](middleman/middleman@f68f6d3) Fix sass tests
- [`36326e4`](middleman/middleman@36326e4) Only libsass ([#2236](https://github-redirect.dependabot.com/middleman/middleman/issues/2236))
- [`38eecc0`](middleman/middleman@38eecc0) Bundler 2
- Additional commits viewable in [compare view](middleman/middleman@v4.2.1...v4.3.1)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=middleman&package-manager=bundler&previous-version=4.2.1&new-version=4.3.1)](https://dependabot.com/compatibility-score.html?dependency-name=middleman&package-manager=bundler&previous-version=4.2.1&new-version=4.3.1)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot[bot] <support@dependabot.com>
purecodecoach added a commit to purecodecoach/bundler-site that referenced this issue Jan 13, 2023
439: Bump middleman from 4.2.1 to 4.3.1 r=segiddins a=dependabot[bot]

Bumps [middleman](https://github.com/middleman/middleman) from 4.2.1 to 4.3.1.
<details>
<summary>Changelog</summary>

*Sourced from [middleman's changelog](https://github.com/middleman/middleman/blob/v4.3.1/CHANGELOG.md).*

> # 4.3.1
> 
> * Fix sassc imports of gem files that expect old sass to be present.
> 
> # 4.3.0
> 
> * Only SassC from now on.
> * Fix regression (all the way back to v3) for Integer/Date keys in YAML. [#2238](https://github-redirect.dependabot.com/middleman/middleman/issues/2238)
> * Fix API to allow rack server according to docs (middleman/middlemanapp.com#794)
> * Require i18n ~> 0.8.0 to handle 0.7.0 security issue.
> * Allow Bundler 2
</details>
<details>
<summary>Commits</summary>

- [`4e078b3`](middleman/middleman@4e078b3) Fix tests
- [`8446772`](middleman/middleman@8446772) Bump gemfile
- [`cadcfed`](middleman/middleman@cadcfed) Prep 4.3.1
- [`2802534`](middleman/middleman@2802534) Import paths from libraries which expect ::Sass module to still exist. Fixes ...
- [`7064872`](middleman/middleman@7064872) Test Ruby 2.6.0
- [`defd945`](middleman/middleman@defd945) Use bundler 1.x for Travis
- [`102247a`](middleman/middleman@102247a) Bump minor version
- [`f68f6d3`](middleman/middleman@f68f6d3) Fix sass tests
- [`36326e4`](middleman/middleman@36326e4) Only libsass ([#2236](https://github-redirect.dependabot.com/middleman/middleman/issues/2236))
- [`38eecc0`](middleman/middleman@38eecc0) Bundler 2
- Additional commits viewable in [compare view](middleman/middleman@v4.2.1...v4.3.1)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=middleman&package-manager=bundler&previous-version=4.2.1&new-version=4.3.1)](https://dependabot.com/compatibility-score.html?dependency-name=middleman&package-manager=bundler&previous-version=4.2.1&new-version=4.3.1)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot[bot] <support@dependabot.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants