0

Adding to gemfile failed and hence I tried gem install rabl. It fails with the following error message, looks like its OS specific... I'm on Windows 7 and using Ruby 2.2 on Rails 5 api

G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:388:in `symlink': symlink() function is unimplemented on this machine (NotImplementedError)
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:388:in `block (2 levels) in extract_tar_gz'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package/tar_reader.rb:65:in `each'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:365:in `block in extract_tar_gz'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:459:in `block in open_tar_gz'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:456:in `wrap'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:456:in `open_tar_gz'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:364:in `extract_tar_gz'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:345:in `block (2 levels) in extract_files'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package/tar_reader.rb:65:in `each'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:342:in `block in extract_files'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package/file_source.rb:30:in `open'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package/file_source.rb:30:in `with_read_io'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/package.rb:339:in `extract_files'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/installer.rb:772:in `extract_files'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/installer.rb:302:in `install'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/resolver/specification.rb:97:in `install'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/request_set.rb:166:in `block in install'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/request_set.rb:156:in `each'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/request_set.rb:156:in `install'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/commands/install_command.rb:205:in `install_gem'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/commands/install_command.rb:255:in `block in install_gems'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/commands/install_command.rb:251:in `each'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/commands/install_command.rb:251:in `install_gems'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/commands/install_command.rb:158:in `execute'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/command.rb:310:in `invoke_with_build_args'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/command_manager.rb:169:in `process_args'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/command_manager.rb:139:in `run'
        from G:/Ruby/ruby/lib/ruby/site_ruby/2.2.0/rubygems/gem_runner.rb:55:in `run'
        from G:/Ruby/ruby/bin/gem:21:in `<main>'

Edit: After lots of googling, found this here

Attempting to use the deploy resource on Windows fails with: symlink() function is unimplemented on this machine (NotImplementedError) This is because Ruby's underlying File.symlink() method does not support Windows.

In the short-term this should be mentioned in the docs. Longer term I think this could be fixed in the same way that the "link" directive works. This method may not work for soft links due to limitations with NTFS.

So, it is definitely Windows specific, but wondering why there's no other post or link explaining that its incompatible with Windows. Isn't this fixable in Windows?

phil pirozhkov
  • 4,740
  • 2
  • 33
  • 40
Saravanabalagi Ramachandran
  • 8,551
  • 11
  • 53
  • 102

1 Answers1

1

This is controversial, but some say symlinking has been implemented on Ruby 2.3. I would try installing it first.

phil pirozhkov
  • 4,740
  • 2
  • 33
  • 40
  • Even then i'm wondering why i couldn't possibly find relevant links when I search `rabl windows` with or without keywords `rails`, `gem`, `install`, `error`...!! – Saravanabalagi Ramachandran Nov 24 '16 at 14:05
  • That's the fact. Ruby is not primarily targeting Windows, and neither Rails does, since prevalent part of developers are using macOS or Linux. I highly recommend using Vagrant with Ubuntu. You will still be able to use your editor of choice, and will have all the working gems. – phil pirozhkov Nov 24 '16 at 14:34
  • Installing `ruby 2.3` and fighting some errors... meanwhile JonathanSoifer's comment [here](http://stackoverflow.com/a/38507114/3125070) makes me feel meh :/ How bout docker, huh? – Saravanabalagi Ramachandran Nov 24 '16 at 16:51
  • Thousand thanks :) Got `Permission denied @ rb_file_s_symlink ` with ruby 2.3, but hey, got it fixed running the `gem install` as admin – Saravanabalagi Ramachandran Nov 24 '16 at 19:41
  • @ZekeDran installing gemfiles as admin is generally a bad idea under Linux/macOS, but you know ;) no advice here – phil pirozhkov Nov 24 '16 at 20:46