How to Install Rvm on Windows 7

How to install RVM on Windows 7

No RVM for you! From RVM’s FAQ:

Does RVM work on windows? Will it in the future?

NO. If you would like to manage multiple versions of ruby on windows please use pik which is an excellent tool by Gordon Thiesfeld. You can find it on GitHub. There are plans to include windows support in RVM 2.0.

How to output CDATA using ElementTree

After a bit of work, I found the answer myself. Looking at the ElementTree.py source code, I found there was special handling of XML comments and preprocessing instructions. What they do is create a factory function for the special element type that uses a special (non-string) tag value to differentiate it from regular elements.

def Comment(text=None):
element = Element(Comment)
element.text = text
return element

Then in the _write function of ElementTree that actually outputs the XML, there's a special case handling for comments:

if tag is Comment:
file.write("<!-- %s -->" % _escape_cdata(node.text, encoding))

In order to support CDATA sections, I create a factory function called CDATA, extended the ElementTree class and changed the _write function to handle the CDATA elements.

This still doesn't help if you want to parse an XML with CDATA sections and then output it again with the CDATA sections, but it at least allows you to create XMLs with CDATA sections programmatically, which is what I needed to do.

The implementation seems to work with both ElementTree and cElementTree.

import elementtree.ElementTree as etree
#~ import cElementTree as etree

def CDATA(text=None):
element = etree.Element(CDATA)
element.text = text
return element

class ElementTreeCDATA(etree.ElementTree):
def _write(self, file, node, encoding, namespaces):
if node.tag is CDATA:
text = node.text.encode(encoding)
file.write("\n<![CDATA[%s]]>\n" % text)
else:
etree.ElementTree._write(self, file, node, encoding, namespaces)

if __name__ == "__main__":
import sys

text = """
<?xml version='1.0' encoding='utf-8'?>
<text>
This is just some sample text.
</text>
"""

e = etree.Element("data")
cdata = CDATA(text)
e.append(cdata)
et = ElementTreeCDATA(e)
et.write(sys.stdout, "utf-8")

How to install Ruby with rvm on Windows 10 with Cygwin64 Terminal?

Edit: Nowadays (2021) the best way to go is not to use Cygwin but rather WSL2. Then you have plenty of tools since you basically have a Linux install. rvm, rbenv or asdf should be able to do the job.

Old answer:
Best way is to use RailsInstaller. It handles most dependencies for you. I wouldn't mess around with RVM in Windows, AFAICT you will have issues along the road trying to use it on a non-UNIX environment.

Install RVM itself without internet connection

I just spent some time and build a tutorial for the offline mode: https://rvm.io/rvm/offline - it's the first version so feel free to improve it here: https://github.com/wayneeseguin/rvm-site/blob/master/content/rvm/offline.md (Edit button).

RVM fails to install Rubies

you have two options:

  1. disable autolibs: rvm autolibs disable
  2. switch to branch with cygwin development:

    rvm get branch /features/cygwin
    rvm requirements

Curl Not a Reconized Command Ruby RVM

Windows doesn't come with the 'curl' command built-in. You can download it from here. But that isn't going to help you much, because RVM doesn't support Windows :)

You can use pik instead.

Unable to install ruby using RVM on WSL 2 and Ubuntu

I can reproduce this exact error if I try rvm install 3.1.2 without having added my user to the rvm group per the installation instructions. Is it possible that you missed this step?

sudo usermod -a -G rvm $USER

After adding the user, then exiting the shell/WSL and restarting, rvm install 3.1.2 (almost) worked as expected. It appears there's a slight bug where it asks for the sudo password on the same line as a previous Updating system.. line, so it's easy to miss, but this is recoverable.

Cygwin rvm error win 7 32-bit

Problem is solved by reinstalling the cygwin with following packages

Vim
git
git-completion
gitk
curl
ruby
sqlite3
libsqlite3_0
libsqlite3-devel
gcc
colorgcc
make
libtool
libncurses-devel
ncurses
openssl
openssl-devel
openssh
zlib
zlib-devel
patch
wget
unzip

Now each and every thing working fine. Thanks every body for providing your support.



Related Topics



Leave a reply



Submit