Error while trying to install vagrant-aws plugin - ruby

I'm trying to add the vagrant-aws plugin to my installation of Vagrant. Upon running this command:
vagrant plugin install vagrant-aws
I get this error message:
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
"c:/Program Files (x86)/Vagrant/embedded/bin/ruby.exe" extconf.rb
creating Makefile
make "DESTDIR="
generating generator-i386-mingw32.def
/bin/sh: -c: line 0: syntax error near unexpected token `x86'
/bin/sh: -c: line 0: `/c/Program\ Files\ (x86)/Vagrant/embedded/bin/ruby -e "puts 'EXPORTS', 'Init_generator'" > generator-i386-mingw32.def'
make: *** [generator-i386-mingw32.def] Error 2
Gem files will remain installed in C:/Users/Steve/.vagrant.d/gems/gems/json-1.8.2 for inspection.
Results logged to C:/Users/Steve/.vagrant.d/gems/gems/json-1.8.2/ext/json/ext/generator/gem_make.out
At first I thought I would need to manually install Ruby and Gem in order to fix this, but then I realized that Vagrant's Bundler system should automatically take care of all this. I'm at a loss and would appreciate any help.

Ahh.. Windows and Linux build/make tools will never get along.
As you can see from the error: /bin/sh: -c: line 0: syntax error near unexpected token ``x86' - The problem is with the parentheses characters in the path.
I think newer Vagrant version solved these problems by installing Vagrant in Program Data directories.

I feel your pain, I stayed up for awhile fighting with this issue. I had just switched over to Linux Mint 17.1 Rebecca from being a long time windows user.
Vagrant version 1.7.2, pretty fresh install of Mint 17.1
Kept getting that same error when trying to install various plugins for vagrant, mainly hostsupdater but I bet this fixes all the issues as it is the same error. I read tons of threads and answers and this is what ended up working.
1: Followed this guide and installed Ruby 2.2.0
http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
Note: Make sure you visit the sites where he links off to the README for installing ruby, his copy paste for code is messed up.
2: You were expecting more, nope!
Installing all plugins just worked perfect after that, did need to use sudo though but other than that.
Hope this saves someone a ton of time looking...

Related

New with Cocoapods, keep getting errors after installing

this is the first time i am doing this, but after following the instructions online for cocoa pods it seems like I can't use it after installing. Can someone please help?
Ronalds-Air:~ ronaldm$ gem install cocoapods --user-install
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb:213: warning: Insecure world writable dir /Users/ronaldm in PATH, mode 040707
Fetching: cocoapods-1.0.1.gem (100%)
WARNING: You don't have /Users/ronaldm/.gem/ruby/2.0.0/bin in your PATH,
gem executables will not run.
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
1 gem installed
and then I tried this way
Ronalds-Air:~ ronaldm$ /Users/ronaldm/.gem/ruby/2.0.0/bin/pod install
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15/rbconfig.rb:213: warning: Insecure world writable dir /Users/ronaldm in PATH, mode 040707
[!] No `Podfile' found in the project directory.
and I tried sudo but that didn't help, any help would be ver much appreciated
The error won't stop you from adding dependencies to your iOS, but it will stop you from being able run any gem executables.
Add the following line at the bottom of your ~/.bash_profile (or create it, if it doesn't exist)
export PATH="~/.gem/ruby/2.0.0/bin:$PATH"

Ruby - ERROR: While executing gem ... (URI::InvalidURIError)

Whenever I tried to install gems recently I am getting the below error
ERROR: While executing gem ... (URI::InvalidURIError)
the scheme http does not accept registry part: www-cache.reith.bbc.co.uk;htt
p: (or bad hostname?)
I am getting this error only recently. Earlier I could install all the gems without any issues. Now, only uninstalling of gems is possible.
I have gone through many solutions and I could find them not specific to my problem.
The issue is, when I copied the command sudo gem install fastlane –NV from the web, -NV contains a bad character, replace dash with a new one and it works fine

Can not install vagrant-librarian-chef on Window?

I am install vagrant-librarian-chef in window 7, but it appear this error:
Installing the 'vagrant-librarian-chef' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
An error occurred while installing chef (12.8.1), and Bundler cannot continue.
Make sure that gem install chef -v '12.8.1' succeeds before bundling.
Warning: this Gemfile contains multiple primary sources. Using source more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run bundle config disable_multisource true.Errno::ENOENT: No such file or directory # dir_s_mkdir - C:/Users/tuan/.vagrant.d/gems/gems/chef-12.8.1-universal-mingw32/acceptance/top-cookbooks/test_run/learn-the-basics-ubuntu/cookbooks/learn-the-basics-ubuntu/.kitchen/kitchen-vagrant/kitchen-learn-the-basics-ubuntu-learn-the-basics-ubuntu-default-ubuntu-1404
Pls help me fix that.
Thanks all!
I was having a similar issue when using the 'ohai' ruby gem. I tried running gem install chef -v '12.8.1' but received an error. I fixed my problem by adding
gem 'chef-config', '~>12.7.2'
to my gemfile.
I looked at my gem dependency tree (gem dependency) and noticed the 'ohai' gem was trying to use chef-config 12.8, so I pinned it to an earlier version.

Ruby error on OS X Yosemite and chef

Getting this error when trying to install chef on OS X Yosemite, other gems have installed fine. Not seeing a requirement. Just wondering if anyone has and idea of what the issue is or has come across this.
$sudo gem install chef
Building native extensions. This could take a while...
ERROR: Error installing chef:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20141023-4708-6api21.rb extconf.rb
creating Makefile
/Library/Ruby/Gems/2.0.0/gems/libyajl2-1.1.0/ext/libyajl2
extconf.rb:104:in `makemakefiles': unhandled exception
from extconf.rb:138:in `<main>'
extconf failed, exit code 1
EDIT: Although my answer below will help you install it on the system version of Ruby. I would probably suggest using RVM instead as the comment below mentions. I do not use Ruby very often and it would probably be fine, but I decided to take the 10 mins to change it to installing to RVM since that way I leave the system ruby untouched.
As I was searching across the web, I could actually resolve this issue (which also appeared on docker/ubuntu) as suggested in this thread:
https://stackoverflow.com/a/32191707/1948319
Long story short: The gmp library is missing. You can install it on ubuntu with
sudo apt-get install libgmp3-dev
I had this problem with this gem specifically, and another gem with c extensions as well.
Turns out I needed to accept new terms & conditions after updating XCode :-)
sudo xcodebuild -license
So I actually answered my own question very shortly after I posted and I hope it helps someone else in the future.
I used this instead:
$ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install chef
The Apple LLVM compiler in Xcode treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.
Came across this issue which was similar enough:
https://github.com/FontCustom/fontcustom/issues/194

Install gem linecache19 : syntax error near unexpected token

I have tried to install a couple of ways but failed each time. Can you help? The outcome is always the same:
...
creating Makefile
make
generating trace_nums-i386-mingw32.def
/usr/bin/sh: -c: line 1: syntax error near unexpected token `Init_trace_nums.sub(/'
/usr/bin/sh: -c: line 1: `C:/Ruby193/bin/ruby -e \puts EXPORTS, + Init_trace_nums.sub(/\..*\z/,)\ > trace_nums-i386-mingw32.def'
make: *** [trace_nums-i386-mingw32.def] Error 258
I've seen several related posts, but none with this message. I'm using pik, in case that makes a difference.
I don't know how to interpret this error message. If I should be opening one of the gem source files and correcting its syntax, what file has this issue? (I've opened several in search.)
Specs: Windows 7, Ruby 1.9.3, Rails 3.2.3
What I've tried:
I have tried on the command line:
gem install linecache19
I have tried adding it to my Gemfile, then calling bundle install
gem 'linecache19'
I have tried downloading it from rubyforge and calling:
gem install linecache19-0.5.13.gem
I succeeded at this after almost a month. The solution was to use Ruby DevKit. Instructions for its installation (don't just unpack it) are here.

Resources