Coder Social home page Coder Social logo

uzbekdev1 / rubyinstaller2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oneclick/rubyinstaller2

1.0 1.0 0.0 1.19 MB

MSYS2 based RubyInstaller for Windows

Home Page: https://rubyinstaller.org

License: BSD 3-Clause "New" or "Revised" License

Ruby 91.52% Dockerfile 0.46% Inno Setup 5.13% HTML 2.08% Batchfile 0.32% PowerShell 0.35% C 0.14%

rubyinstaller2's Introduction

Build status

RubyInstaller2

This project provides an Installer for Ruby-2.4 and newer on Windows based on the MSYS2 toolchain. It is the successor to the MSYS1 based RubyInstaller which is used for Ruby-2.3 and older. It is licensed under the 3-clause Modified BSD License.

In contrast to the old RubyInstaller it does not provide its own DevKit, but makes use of the rich set of MINGW libraries from the MSYS2 project. It therefore integrates well into MSYS2 after installation on the target system to provide a build-and-runtime environment for installation of gems with C-extensions. This and more changes are documented in the CHANGELOG.

Using the Installer on a target system

The base ruby installation packaged into the installer file is enough to use pure Ruby gems or fat binary gems for x64-mingw32 or x86-mingw32. However installing C based source gems fail, due to unavailable development tools. Fortunately it can be added easily.

  • Run the ridk install step on the last step of the installation wizard

It downloads and installs all necessary MSYS2 build tools that are typically required to compile C based ruby gems. Some gems require additional packages, which can be installed per pacman. See below. Its also possible to install MSYS2 manually from https://msys2.github.io/ and run ridk install afterwards to add non default, but required development tools. For unattended install of Ruby and MSYS2 see the FAQ chocolatey install.

The ridk command

ridk is a cmd/powershell script which can be used to install MSYS2 components, to issue MSYS commands like pacman or to set environment variables for using MSYS2 development tools from the running shell.

See ridk help for further options:

  Usage:
      C:/Ruby24-x64/bin/ridk.cmd [option]

  Option:
      install                   Install MSYS2 and MINGW dev tools
      exec <command>            Execute a command within MSYS2 context
      enable                    Set environment variables for MSYS2
      disable                   Unset environment variables for MSYS2
      version                   Print RubyInstaller and MSYS2 versions
      use                       Switch to a different ruby version
      help | --help | -? | /?   Display this help and exit

ridk enable can be used to enable MSYS2 development tools on the running console. This makes sh, pacman, make etc. available on the command line. See the Wiki for further instructions to the ridk command.

Install gems with C-extensions and additional library dependencies

The base MSYS2 setup includes compilers and other build tools, but doesn't include libraries or DLLs that some gems require as their dependencies. Fortunately many of the required libraries are available through the MSYS2 repositories. They can be installed per ridk exec pacman -S mingw-w64-x86_64-libraryname similar to apt-get on Linux. Exchange the prefix mingw-w64-x86_64 by mingw-w64-i686 for the 32-bit RubyInstaller.

For instance these popular gems can be installed like so from the source gem:

  • To install sqlite3 gem:
      ridk exec pacman -S mingw-w64-x86_64-sqlite3
      gem install sqlite3 --platform ruby
  • To install nokogiri gem:
      ridk exec pacman -S mingw-w64-x86_64-libxslt
      gem install nokogiri --platform ruby -- --use-system-libraries

Some gems are properly labeled to install dependent libraries per pacman. See the wiki how such a label can be added to gems. Also refer the FAQ for additional install recommendations.

Building the Installer

This repository provides the packaging tasks to build RubyInstaller setup executables and 7zip files. It doesn't compile any sources, but makes use of the MSYS2-MINGW repository and the RubyInstaller2 pacman repository to download binaries and dependent libraries.

Automatic build on Appveyor

The installer is regularly built on AppVeyor for each push to the github repository. AppVeyor also executes the installer and runs all tests on it, so that we are notified about breaking changes. In addition to this, a daily build of the latest ruby development snapshot is compiled and packaged as RubyInstaller files. It can be downloaded from github releases or from AppVeyor as build artifacts. Check the wiki on how to use ruby-head versions on Appveyor for your CI builds.

Build RubyInstaller2 on your own machine:

  • Make sure you have a working RubyInstaller-2.4 and Git installation
  • Install the MSYS2 environment per ridk install with default options
  • Install the latest Inno-Setup (unicode) from http://www.jrsoftware.org/isdl.php
  • Run cmd.exe and add iscc.exe to PATH:
      set PATH=%PATH%;"c:\Program Files (x86)\Inno Setup 5"
  • Clone RubyInstaller2 and build all RubyInstaller versions for x86 and x64:
      git clone https://github.com/larskanis/rubyinstaller2
      cd rubyinstaller2
      bundle install
      bundle exec rake
  • If everything works well, you will find the final setup and archive files:
    • packages/rubyinstaller/recipes/installer-inno/rubyinstaller-<VERSION>-<ARCH>.exe
    • packages/rubyinstaller/recipes/archive-7z/rubyinstaller-<VERSION>-<ARCH>.7z
  • Also try rake -T to see the available build targets.

Known Issues

  • Avoid running this project in a PATH containing spaces.
  • Ruby on Windows is still using non UTF-8 default external encoding: Raised as ruby bug.
  • Also refer to the issue list.

rubyinstaller2's People

Contributors

aharpervc avatar ashmaroli avatar jbampton avatar kjarrigan avatar larskanis avatar msp-greg avatar vais avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.