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

ERROR NotImplementedError: fork() #278

Closed
sebastjan-hribar opened this Issue Jun 29, 2015 · 9 comments

Comments

Projects
None yet
6 participants
@sebastjan-hribar
Copy link

sebastjan-hribar commented Jun 29, 2015

Hi,
I'm on Windows 7 with Ruby 2.00 and when running the bookshelf sample application I get:

ERROR NotImplementedError: fork() function is unimplemented on this machine
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/shotgun-0.9.1/lib/shotgun/loader.rb:27:in fork' C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/shotgun-0.9.1/lib/shotgun/loader.rb:27:incall!'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/shotgun-0.9.1/lib/shotgun/loader.rb:18:in call' C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/lint.rb:49:in_call'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/lint.rb:37:in call' C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/showexceptions.rb:24:incall'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in call' C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:incall'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in service' C:/Ruby200-x64/lib/ruby/2.0.0/webrick/httpserver.rb:138:inservice'
C:/Ruby200-x64/lib/ruby/2.0.0/webrick/httpserver.rb:94:in run' C:/Ruby200-x64/lib/ruby/2.0.0/webrick/server.rb:295:inblock in start_thread'

Can this be fixed or bypassed on Windows 7?

Thank you,
seba

@jodosha

This comment has been minimized.

Copy link
Member

jodosha commented Jun 29, 2015

@sebastjan-hribar Hello and thanks for reporting this. Lotus uses a reloadable container (shotgun gem) to provide code reload feature to developers. Unfortunately it works with fork(2), which is only available on POSIX systems.

That means you won't be able to use code reloading on Windows. To get your application running, please use bundle exec lotus server --no-code-reloading. This should let you use Lotus on windows.

I'm closing this, feel free to reopen, if you're still experiencing problems.

@jodosha jodosha closed this Jun 29, 2015

@jodosha jodosha added the question label Jun 29, 2015

@jodosha jodosha self-assigned this Jun 29, 2015

@SleeplessByte

This comment has been minimized.

Copy link
Contributor

SleeplessByte commented Sep 9, 2015

I know this has been long closed, @sebastjan-hribar; I found a way to mimic shotgun as closely as possible:

gem install restart

Put in your Gemfile:

gem 'wdm', '>= 0.1.0' if Gem.win_platform?

Run in cmd.exe or whatever shell you are using

restart bundle exec lotus server --no-code-reloading < nul

It is anything but pretty. The restart gem polls for changes in the working directory or subdirectory's, terminates the current process and runs it again. You flood the input channel with nul so that the Terminate batch job (Y/N)? messages are automagically answered. Finally install the wdm gem to use event based file changes instead of polling (which is resource intense).

@AlfonsoUceda

This comment has been minimized.

Copy link
Member

AlfonsoUceda commented Sep 9, 2015

@SleeplessByte thanks for the info ;)

@SleeplessByte

This comment has been minimized.

Copy link
Contributor

SleeplessByte commented Sep 9, 2015

👍

Myself I use a different technique.

Create a run.bat file in your root directory:

start bundle exec lotus server --no-code-reloading < nul

Now open a shell in your root directory

run

It will open a new shell with your server. When you want to re-load the code, just close the prompt and call run again.

@sebastjan-hribar

This comment has been minimized.

Copy link
Author

sebastjan-hribar commented Sep 10, 2015

Thank you, I've tried your approach and it worsk fine.

@gvaldezsan

This comment has been minimized.

Copy link

gvaldezsan commented Jan 3, 2016

Talking about this again, but shouldn't a small mention to the issue on windows with shotgun be added on the Getting Started Guide?

@jodosha

This comment has been minimized.

Copy link
Member

jodosha commented Jan 3, 2016

@gvaldezsan Yes, can you please open a PR for that? Your help would be really appreciated. 👍

@gvaldezsan

This comment has been minimized.

Copy link

gvaldezsan commented Jan 3, 2016

sure, willdo when i get home later!

@joneslee85

This comment has been minimized.

Copy link
Member

joneslee85 commented Jan 3, 2016

@gvaldezsan thanks mate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment