-
Notifications
You must be signed in to change notification settings - Fork 215
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
Running a development version on Windows #547
Comments
What exactly does rstat.us use unicorn for? I would assume it's just for production, right? |
yep. just for production. webrick is used in development, although thin could possibly be used too if somebody wanted. but unicorn is not. unicorn is unix/unixish only. |
Why wouldn't you let the individual pick their web server? If you want to leave unicorn in, move it to the production group and comment it out with a "strongly recommended" comment about why it's there. That way it's not used in dev mode and can't afflict the afflicted windows ruby devs, all both on them ;) |
@tgraham that sounds like a good plan-- I'd be happy to merge in a pull request along those lines :) |
Now that rstat.us uses Thin instead of Unicorn, does it run on Windows? |
A quick bit of research shows, yes, Thin does run on Windows, but it may take some finagling. One must install a pre-release version of eventmachine. This step may no longer be necessary, but was as of June 2012. http://stackoverflow.com/questions/3649252/cannot-install-thin-on-windows |
Thin runs fine in windows. No finagling necessary. |
Can we close this issue then? Or is there something else in rstat.us that doesn't work on Windows? |
In order for me to feel comfortable closing this, I would like someone to actually try running the current code on windows. I just tried on my aging netbook and I couldn't even get |
I mainly develop on Windows using Vagrant but for this I will try to run it natively and report back as I know how painful it used to be to develop natively on Windows back when I started working with Ruby. |
So, I had to remove therubyracer from my Gemfile (which I thought wasn't there?) and then it would bundle just fine with 'bundle install --without production' to avoid installing unicorn. Then it complained about there not being a 'libxml2-2.dll' which is NotOurFault, but I found the dll and copied it somewhere visible by the path. We should look at patching libxml-ruby to correct for this. The DLL was in rubyroot\lib\ruby\gems\1.9.1\gems\libxml-ruby-2.3.3-x86-mingw32\lib\libs when it should have probably just been in the parent directory. After doing this manual operation, the site loaded just fine. It only took me probably 10 minutes to figure all of this out. I feel a little dirty now, though. |
Using RubyInstaller+DevKit I was also able to get it working but only after removing "unicorn" and "therubyracer" from the Gemfile and copying "libxml2-2.dll" to a more visible path location. Other then that, I don't see any other issues so far. |
I told you |
Again, therubyracer may be necessary on some Linux environments that do not have a js engine. Windows and OS X already have one installed by force on the system, which the js parts of the application will discover and use. It would be nice to be able to specify an engine like this just in case, but have it not be used if it's unnecessary, but that's not one of Bundler's usecases. Generally, therubyracer is something that should only be used in a Linux environment and, long story short, Bundler does not have a good way to specify the platform. |
I did some quick research on specifying the platform in bundler and came up with this: https://github.com/carlhuda/bundler/wiki/Platform-as-a-parameter It's possible to fake it using groups, but I agree that such is a less than ideal solution. |
I would think that using either RUBY_PLATFORM =~ /stuff to match here/ or a :platform => :ruby for therubyracer would solve this. I don't have a windows machine to test that theory though. |
Thank you everyone! This was a big help <3 <3 <3 Would anyone like to get a patch in to update the README with Windows setup instructions:
Then another potential patch would be handling therubyracer. Looking at the link @colindean mentioned, it looks like there's a way within the Gemfile to only use therubyracer on linux without requiring everyone to use
Anyone? |
@carols10cents so, let me get this straight: you want to be able to have |
I think |
Being a former Ruby Windows dev, I know they DO exist, and we should all be trying to make it better to develop in Ruby on Windows.
First problem I know about -- we have unicorn in the Gemfile, which I doubt is required for development, and that (more specifically its dependency kgio) is only supported on unix systems.
The text was updated successfully, but these errors were encountered: