6

I am using Windows 10 Insider built with Bash enabled. lsb_release shows its Ubuntu 14.04 LTS. So, I was wondering finally I can install RoR on Windows 10 and not use other installers. Because they say its Ubuntu on Windows.

I am following GoRails Guide by Chris Oliver to set RoR on Ubuntu 14.04 Win10. I tried both method using RVM & Rbenv but I ended up with errors

I also asked Chris to write a guide for this on his website and he thought it would be a great idea and but his only concern was opening up ports with Linux Software on Windows and connect to it

I am sure someone will soon find a way to install rails on Windows 10 but meanwhile I want to know if its possible or not? If yes what is it that I am doing wrong. Help me to fix it. Also what should I use for this RVM or RBENV. Which would be better in this case?

(Note: Please let me know if this looks like two different questions. I will edit it. I don't even know if its possible or not. Fixing errors is the later part.)

Here is rbenv error messages:

$ rbenv install 2.3.0
Downloading ruby-2.3.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2
Installing ruby-2.3.0...

BUILD FAILED (Ubuntu 14.04 using ruby-build 20160426-12-gf03f7f8)

Inspect or clean up the working tree at /tmp/ruby-build.20160513120821.313
Results logged to /tmp/ruby-build.20160513120821.313.log

Last 10 log lines:
rm -f ../../../.ext/x86_64-linux/io/wait.so  *.o  *.bak mkmf.log .*.time
rm -f Makefile extconf.h conftest.* mkmf.log
rm -f core ruby *~
rmdir --ignore-fail-on-non-empty -p  2> /dev/null || true
make[2]: Leaving directory `/tmp/ruby-build.20160513120821.313/ruby-2.3.0/ext/io/wait'
make[1]: Leaving directory `/tmp/ruby-build.20160513120821.313/ruby-2.3.0'
Generating RDoc documentation
./ruby is not found.
Try `make' first, then `make test', please.
make: *** [rdoc] Error 1

RVM error messages:

-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.bz2
Installing ruby-2.3.0...

BUILD FAILED (Ubuntu 14.04 using ruby-build 20160426-12-gf03f7f8)

Inspect or clean up the working tree at /tmp/ruby-build.20160513120821.313
Results logged to /tmp/ruby-build.20160513120821.313.log

Last 10 log lines:
rm -f ../../../.ext/x86_64-linux/io/wait.so  *.o  *.bak mkmf.log .*.time
rm -f Makefile extconf.h conftest.* mkmf.log
rm -f core ruby *~
rmdir --ignore-fail-on-non-empty -p  2> /dev/null || true
cooldudeabhi@ACERASPIRE:~$ rvm install 2.3.0
ruby-2.3.0 - #removing src/ruby-2.3.0..
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/ubuntu/14.04/x86_64/ruby-2.3.0.ta                    r.bz2
Checking requirements for ubuntu.
Requirements installation successful.
df: Warning: cannot read table of mounted file systems: No such file or director                    y
ruby-2.3.0 - #configure
ruby-2.3.0 - #download
ruby-2.3.0 - #validate archive
cat: /dev/fd/63: No such file or directory
cat: /dev/fd/63: No such file or directory
The downloaded package for https://rubies.travis-ci.org/ubuntu/14.04/x86_64/ruby                    -2.3.0.tar.bz2,
Does not contains single 'bin/ruby' or 'ruby-2.3.0',
Only '' were found instead.
Mounting remote ruby failed with status 4, trying to compile.
df: Warning: cannot read table of mounted file systems: No such file or director                    y
Checking requirements for ubuntu.
Requirements installation successful.
grep: write error: Broken pipe
sort: fflush failed: standard output: Broken pipe
sort: write error
Installing Ruby from source to: /home/cooldudeabhi/.rvm/rubies/ruby-2.3.0, this                     may take a while depending on your cpu(s)...
ruby-2.3.0 - #downloading ruby-2.3.0, this may take a while depending on your co                    nnection...
ruby-2.3.0 - #extracting ruby-2.3.0 to /home/cooldudeabhi/.rvm/src/ruby-2.3.0..rvm install 2.3.0
1

1 Answer 1

12

It appears it isn't possible as of build 14342, as this is an issue with Bash on Windows itself [1].

Some internal testing builds are reported to be able to install ruby via RVM, but it does not appear any of these builds are currently available to the 'fast' ring of Windows Insiders at this time [2].


Update: 2016-05-27

One step closer: Build 14352 was released on 2016-05-26 [3]. After running apt-get update && apt-get upgrade I was able to successfully install ruby-2.3.1 using both rvm and rbenv.

As noted in source #1 below, in order to fully utilize rvm I needed to run bash with /bin/bash --login. To achieve this I appended it to the Bash on Ubuntu on Windows shortcut's target field like this:

C:\Windows\System32\bash.exe -c "cd ~ && /bin/bash --login"

Now I can rvm use ruby-2.3.1 --default, gem install rails and rails new banana, however when bundler tries to run, there is an error:

dozers@DRAGONSTONE:~/banana$ bundle
--- ERROR REPORT TEMPLATE -------------------------------------------------------
...
Error details

    ArgumentError: parent directory is world writable but not sticky
      /home/dozers/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tmpdir.rb:93:in `ensure in mktmpdir'
      /home/dozers/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/tmpdir.rb:95:in `mktmpdir'
      /home/dozers/.rvm/gems/ruby-2.3.1/gems/bundler-1.12.5/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb:29:in `update'
...
--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=parent+directory+is+world+writable+but+not+sticky&type=Issues

Update: 2016-06-03

The cat: /dev/fd/63: No such file or directory error is reported to be fixed in an upcoming Windows Insider release [4], but this doesn't seem to be fatal.

As a temporary workaround for the bundler error, issuing chmod -R +t ~/.bundle/cache appears to do the trick and now you have a working rails installation [5].


Sources:

  1. https://github.com/Microsoft/BashOnWindows/issues/9#issuecomment-207978726
  2. https://github.com/Microsoft/BashOnWindows/issues/222#issuecomment-214561156
  3. https://blogs.windows.com/windowsexperience/2016/05/26/announcing-windows-10-insider-preview-build-14352/
  4. https://github.com/Microsoft/BashOnWindows/issues/266#issuecomment-219576351
  5. https://github.com/bundler/bundler/issues/4630#issuecomment-223576426
3
  • Your update from 3 June helped me get bundler working on my Windows 10 insider preview install of the bash terminal. I can also confirm that as of a recent update Ruby 2.3.1 installs properly (though I'm not sure which update fixed it as there've been a few since my last attempt). I'm using chruby if that matters.
    – MattD
    Jun 26, 2016 at 4:35
  • 1
    for those who are wondering to set RoR on Windows Bash....its done now :) gorails.com/setup/windows/10 Jun 26, 2016 at 19:17
  • On my Anniversary Edition Windows 10 it seems to work without much intervention, although I needed to sudo apt-get install autoconf for nokogiri to build without errors during bundle install. Aug 6, 2016 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.