繁体   English   中英

在Ubuntu Bash Windows 10上安装rails

[英]Installing rails on Ubuntu Bash 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

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

从构建14342开始 ,这似乎是不可能的,因为这是WindowsBash的一个问题[1]

据报道,一些内部测试版本能够通过RVM安装ruby,但目前Windows Insiders的“快速”环中似乎没有任何这些版本可用[2]


更新:2016-05-27

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

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

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

现在我可以rvm use ruby-2.3.1 --defaultgem install railsrails new banana ,但是当bundler尝试运行时,会出现错误:

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

更新:2016-06-03

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

作为bundler错误的临时解决方法,发出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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM