Invalid directory for Ruby Development Kit - ruby

I'm trying to install the Ruby Development Kit from http://rubyinstaller.org/downloads but I run into some problems at the command prompt.
After running C:\Ruby\DevKit>ruby dk.rb init I got the following success response:
[INFO] found RubyInstaller v2.0.0 at C:/Ruby/Ruby200-x64
Initialization complete! Please review and modify the auto-generated 'config.yml' file to ensure it contains the root directories to all of the installed Rubies when you run 'ruby dk.rb install'.
Then I ran C:\Ruby\DevKit>ruby dk.rb review and got this success response:
Based upon the settngs in the 'config.yml' file generated from running 'ruby dk.rb init' and any of your customizations, DevKit functionality will be injected into the following Rubies when you run 'ruby dk.rb install'.
C:/Ruby/Ruby200-x64
Finally, I ran the C:\DevKit>ruby dk.rb install line, as it seems everything was working fine up until this point. Unfortunately, I keep getting this message:
[ERROR] Skipping invalid directory 'C:/Ruby/Ruby200-x64'
I don't know what to do! Thanks kindly for the help.

I had the same error. As mentioned by TSG, config.yml had wrong path for ruby. For example, mine installed it to c:\Ruby200x64 but the config.yml had it as c:\Ruby200-x64 .
config.yml takes it from path variables of windows. If you use windows, I suggest you to update your path environment variables as well.. both user variables and system variables..

Looks like you changed the name of your Ruby directory from Ruby200-x64 to Ruby. In your DevKit folder, open the file "config.yml" and change the last line to reflect the proper folder name of your Ruby install.

Related

Why does ruby 2.4.0 always try to install when i enter this directory?

Every time I enter into this specific directory, I get a message that ruby-2.4.0 is not installed. I'm wondering if I set something to run a command when I enter this directory, but I'm having trouble locating where it may be doing this so that I can not have it run anything when i go into this folder.
% cd omnibus
Required ruby-2.4.0 is not installed.
To install do: 'rvm install "ruby-2.4.0"'
It looks like you have RVM installed on that machine. RVM adds a hook to your shell that detects when you change into a directory with a configuration file specifying what Ruby version to use.
You can run ls -la in your omnibus directory to look for that configuration file. It is probably named .ruby-version.

Middleman command not found/ Bundler not working

I'm trying to install middleman. I installed the gem and can see it in my gem list. However, if I enter middleman -v I get the message middleman: command not found.
I tried installing bundler to run middleman with a Gemfile in the project directory using bundle exec middleman. But when I try to run bundle I get the following error:
bash: /usr/bin/bundle: /usr/bin/ruby: bad interpreter: No such file or directory
I'm running ruby v. 2.6 and installed middleman v.4.3.5 on Ubuntu 18.04.
Any help would be very much appreciated; I've wasted half a day trying to solve this and I'm still on high waters!
which ruby gives me /snap/bin/ruby and my path variable is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/share/rvm/bin. The problem is that ruby is in the snap folder.
I just uninstalled the ruby snap (and snaps in general) and installed "normal" Ruby, which had the correct path (usr/bin/ruby). The middleman installation then worked fine.

The 'puma' native gem requires installed build tools

I have got this error when running bundle install
Gem::InstallError: The 'puma' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
I'm using RailsInstaller which already has DevKit.
I didn't have this problem before but I seem to get it after I changes the ruby version from 2.2.4 to 2.2.5. I'm using a windows computer. Any idea how to solve this issue?
I solved the problem by following these instruction:
download devkit from here.
Install the file in DevKit folder
open cmd and navigate to the folder
Copy the path of the ruby folder you installed in C drive and paste it in the DevKit\config.yml. Change ‘/’ in the path to ‘\’.
It should look like this:
# Example:
#
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
#
---
- C:\Ruby22
Run ruby dk.rb install
Back to your rails folder, run bundle install and you should not have any errors

How to avoid the source being overwritten when compiling a Gem?

I am trying to install eventmachine Gem, however a line needs to be commented out in the source for this to work on Ruby 2.0 on Windows x64.
I have tried modifying the Gem source in the Ruby build folder but each time I run gem install eventmachine it overwrites my changes. From the command line help there does not appear to be a way to rebuild the gem without unpacking fresh source, however there may be a workaround.
Is there a way to build my slightly tweaked source for this Gem?
Don't install the gem like that. Instead, build your own version and install that instead by specifying the path to the .gem file that is produced as part of the build process.
I've found the easiest way to get this right is to create a fork, set the fork's git path in your Gemfile, and bundle install which will take care of compiling things and installing them correctly.
Ok figured it out thanks to help from #tadman.
Ended up just installing locally from source rather than tweaking the official source downloaded by gem and preventing it from being overwritten. These are the exact steps ...
Clone locally from Github (or wherever)
Make your changes to the source
If there is a .gemspec file in the root directory
Open terminal in the directory and enter gem build GEMNAME.gemspec
Finally enter gem install GEMNAME-VERSION.gem
If there is not .gemspec but there is a file called "gem" or "build" or something similar , then you may have to build using rake according to this reply

ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format

I am developing a Sencha touch 2 application. I have been following the "Styling the user interface of a Sencha Touch application" tutorial on theming of secha touch applications.
It requires me to install Ruby, Compass and SASS.
I installed Ruby using the installer from rubyinstaller.org.
On executing the following command, I get the expected result which confirms correct installation:
C:\>ruby -v
ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
Current source is up to date:
C:\>gem sources
** CURRENT SOURCES **
http://rubygems.org/
Next, since I am behind a proxy, I used the following command to install HAML/Compass:
C:\>gem install -p [proxy:port] compass
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format**
Can someone help me? I found solutions such as system update, gem sources update, but everything is up to date on my system.
Edit:
C:\>gem install compass
works perfectly fine on my private system. When I try the same command from my workplace I need to use the proxy as mentioned above and that results in an error.
I assume the ERROR occurs since the web sense at my workplace blocks these downloads.
Solution: I downloaded the required gems: chunky_png, fssm, compass, sass, haml etc.. directly from http://rubygems.org/gems and placed these gems in my local directory.
After this I tried gem install compass. This first searches your local directory. On finding the required gems, installation takes place. Does not require connection to the ruby website.
Note: Run the command from the path where the gems are located
eg: I have placed the gems in C:\Ruby193\lib\ruby\gems\1.9.1\gems
So I run the following command :
C:\Ruby193\lib\ruby\gems\1.9.1\gems>gem install compass
I had a similar problem, it worked on my own private laptop, but failed while using a virtual server at work (running Ubuntu 12.10) that used a proxy.
Following the suggestion I found here, from the command line I defined:
export HTTPS_PROXY=proxy-address:proxy-port-number
export HTTP_PROXY=proxy-address:proxy-port-number
and then my gem install package worked fine.

Resources