Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

build on windows #172

Closed
wants to merge 2 commits into from
Closed

Conversation

stereobooster
Copy link

@buildhive
Copy link

Charles Lowell » therubyracer #54 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive
Copy link

Charles Lowell » therubyracer #55 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive
Copy link

Charles Lowell » therubyracer #56 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@stereobooster
Copy link
Author

Checked out the right version of v8 (3.9.11)

cd v8
scons os=win32 toolchain=gcc library=shared
cd ../therubyracer
bundle --without libv8
SET PATH=path_where_v8\v8;%PATH%
bundle exec rake compile
bundle exec rake
D:/tools/ruby192/bin/ruby.exe -S rspec ./spec/redjs_spec.rb ./spec/threading_spe
c.rb ./spec/c/array_spec.rb ./spec/c/constants_spec.rb ./spec/c/exception_spec.r
b ./spec/c/external_spec.rb ./spec/c/function_spec.rb ./spec/c/handles_spec.rb .
/spec/c/locker_spec.rb ./spec/c/object_spec.rb ./spec/c/script_spec.rb ./spec/c/
string_spec.rb ./spec/c/template_spec.rb ./spec/c/trycatch_spec.rb ./spec/mem/bl
unt_spec.rb ./spec/v8/context_spec.rb ./spec/v8/conversion_spec.rb ./spec/v8/err
or_spec.rb ./spec/v8/function_spec.rb --tag ~memory --tag ~threads
Run options: exclude {:memory=>true, :threads=>true}
*...................................

Pending:
  V8::Context not ready for prime-time
    # No reason given
    # ./spec/redjs_spec.rb:8

Finished in 0.257 seconds
36 examples, 0 failures, 1 pending

Changes made in build.rb should be done in libv8. I will send PR

@buildhive
Copy link

Charles Lowell » therubyracer #57 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@stereobooster
Copy link
Author

Moved changes from build.rb to libv8 see rubyjs/libv8#40

@cowboyd cowboyd mentioned this pull request Sep 6, 2012
@stereobooster stereobooster mentioned this pull request Sep 6, 2012
@stereobooster
Copy link
Author

Latest master + my patch gives segmentation fault

@mcandre
Copy link

mcandre commented Apr 12, 2013

Any more development on this? Windows support for ruby racer would be fantastic.

@mattconnolly
Copy link

Can one of the admins verify this patch?

@joshco
Copy link

joshco commented May 28, 2016

@stereobooster How do I use this?

@joshco
Copy link

joshco commented May 28, 2016

@stereobooster I did a gem install on the .gem file, and then I copied the lib_v8 DLLs and .a files to my ruby/bin
But Im getting a load error when i require 'v8'. Any Ideas?

irb(main):002:0> require 'v8'
LoadError: 126: The specified module could not be found.   - C:/Ruby200/lib/ruby/gems/2.0.0/gems/therubyracer-0.11.0beta1-x86-mingw32/lib/v8/init.so
        from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/therubyracer-0.11.0beta1-x86-mingw32/lib/v8.rb:4:in `<top (required)>'
        from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:133:in `require'
        from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
        from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:40:in `require'
        from (irb):2
        from C:/Ruby200/bin/irb:12:in `<main>'

@stereobooster
Copy link
Author

stereobooster commented May 29, 2016

Let me tell you a story.

Long, long time ago I started development using WAMP. Then I recognised what a big pile of useless unpleasant substance PHP was, and switch to ruby (still using windows). That was a time when I tried to implement that patch. Problem with rubyracer is only tip of iceberg of problems using ruby on windows.
Later I realised I will need to deploy to *nix platform anyway, because it is best practice for web development. So I switched to setup with VirtualBox. Linux(ubuntu) + ruby + nginx and optional pgsql, redis etc., all inside virtual machine. Plus shared filesystem to be able to edit text under windows. Plus expose 80 and 22 port, to be able to use browser under main system and putty for SSH. It is possible start VirtualBox in windowless mode.
I'm strongly advice this setup to you.

Later I switched to linux as my main OS. And as of now I'm using Mac OS. I do not have access to Windows machine, so I can not help you with that problem.

If you still willing to fix this error, I would suggest you to give it what it wants, e.g. setup include path that way that it includes init.so, which is most probably part of MinGW, which is a part of DevKit

So long and thanks for all the fish

@joshco
Copy link

joshco commented May 29, 2016

Thanks for the response. I'm familiar with that story. I've been a Rails developer on windows for about 4 years now, so I understand the pain and I understand why you switched. My memory tells me that at some point in the past, on a different machine while developing a different app, I got rubyracer to work on windows (using your solution), but I can't remember how.

I've thought about doing a virtual linux machine, or vagrant to make development and testing easier. What's kept me from embracing that is the awesome experience of RubyMine. If I could figure out a seamless way to set up a vagrant with RubyMine so I have the rubymine UI running on the windows host, but connected to the VM for debugging and testing, I'd make the switch. I haven't found a good HOWTO on that.

There is also now an UbuntuOnWindows effort that may offer some hope down the road. Eg, run ruby linux binaries on windows without a VM.

http://blog.dustinkirkland.com/2016/03/ubuntu-on-windows.html

Re fixing the bug, I'm down to try. Is your suggestion for use in compiling therubyracer (with the code from your pull request/branch)? init.so is actually present in the gem's directory. My guess is that it is actually finding the init.so, but something in init.so is looking for the DLLs (or .a files?) and maybe there is something sticky in the reference so it cannot find the DLLs (which are in ruby/bin and windows/system32). So maybe it's just something to do in recompiling.

Im using Ruby 2.0x86 32 bit on Windows 10 64bit
Would you happen to have a link to the steps I should use to recompile? Should I work with your branch?

@ignisf
Copy link
Collaborator

ignisf commented May 29, 2016

Hi @joshco, first of all, did you try installing the latest version of therubyracer?

@joshco
Copy link

joshco commented May 29, 2016

@stereobooster Yes, that was my first approach. It tried to build it with devkit and failed.

@ignisf
Copy link
Collaborator

ignisf commented May 29, 2016

Could you open up a new issue detailing the failure? If it's during the compilation of therubyracer, open it here, if it's in libv8, open it over at https://github.com/cowboyd/libv8

Thanks

@stereobooster stereobooster deleted the windows branch June 30, 2017 15:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants