Ruby version management is useful when using different versions of Ruby for each project. In Windows environments, you can’t directly use rbenv or RVM, which are widely used in Unix-like systems, so you need to use alternative tools. Here we introduce two tools: uru and pik.
rbenv
rbenv is primarily a Ruby version management tool for Unix-like OSes. It’s not officially supported on Windows. Therefore, in Windows environments, you need to use other tools.
uru
uru is a tool for managing Ruby versions in Windows environments. It’s lightweight and easy to install.
Installing uru
- Download the latest version from uru’s official site.
- Extract the downloaded file and navigate to the directory containing
uru_rt.exe. - Open a command prompt and execute the following command:
Note: It must be executed from the same directory asuru_rt admin installuru_rt.exe. Otherwise, you’ll get the following error:[ERROR] must install from same directory as uru_rt.exe
pik
pik is a Ruby version management tool for Windows. While it’s an older tool, it’s useful for specific version management.
Using pik
- Check the installation instructions at pik’s official site.
- When installing Ruby versions, you may encounter the following error:
pik install ruby 1.9.3 There was an error. Error: private method `gsub' called for nil:NilClass
Rails Tutorial (3)
Examples of commands to generate and delete controllers for Rails applications.
# Generate controller
$ rails generate controller StaticPages home help
# Delete controller
$ rails destroy controller StaticPages home help