在Ubuntu Bash Windows 10上安装rails

Abh*_*yan 6 ubuntu ruby-on-rails rvm rbenv windows-10

我正在使用启用了Bash的Windows 10 Insider.lsb_release显示其Ubuntu 14.04 LTS.所以,我想知道最后我可以在Windows 10上安装RoR而不使用其他安装程序.因为他们在Windows上说它的Ubuntu.

我正在按照Chris Oliver的GoRails指南在Ubuntu 14.04 Win10上设置RoR.我尝试了使用RVM和Rbenv的两种方法,但我最终得到了错误

我还要求Chris在他的网站上为此写一个指南,他认为这是一个好主意,但他唯一担心的是在Windows上用Linux软件打开端口并连接到它

我相信有人很快会找到一种在Windows 10上安装rails的方法,但同时我想知道它是否可能?如果是的话,我做错了什么.帮我解决一下.此外,我应该为此RVM或RBENV使用什么.在这种情况下哪个更好?

(注意:如果这看起来像两个不同的问题,请告诉我.我会编辑它.我甚至不知道它是否可能.修复错误是后面的部分.)

这是rbenv错误消息:

$ 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
Run Code Online (Sandbox Code Playgroud)

RVM错误消息:

-> 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
Run Code Online (Sandbox Code Playgroud)

joe*_*ler 12

这似乎是不可能的,因为建立的14342,因为这是一个问题猛砸在Windows本身的[1] .

一些内部测试版本是报告能够通过RVM安装Ruby,但它并没有出现任何的这些版本是目前可用于Windows业内人士的"快"环在这个时候[2] .


更新:2016-05-27

更进一步: Build 14352于2016-05-26发布[3].运行后,apt-get update && apt-get upgrade我能够ruby-2.3.1使用rvm和rbenv 成功安装.

如下面的源#1所述,为了充分利用rvm,我需要运行bash /bin/bash --login.为了实现这一点,我将它附加到Windows快捷方式的目标字段上的Ubuntu上Bash,如下所示:

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

现在我可以rvm use ruby-2.3.1 --default,gem install railsrails new banana,但是当打捆尝试运行,有一个错误:

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
Run Code Online (Sandbox Code Playgroud)

更新:2016-06-03

cat: /dev/fd/63: No such file or directory据报道,这个错误将在即将发布的Windows Insider版本[4]中修复,但这似乎并不致命.

作为捆绑器错误的临时解决方法,发布chmod -R +t ~/.bundle/cache似乎可以解决问题,现在您已经安装了导轨[5].


资料来源:

  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