Errors Installing vagrant.berkshelf - ruby

I working on a Windows 7 machine with Vagrant v 1.4.1 and I have been struggling to install the vagrant-berkshelf plugin. I'm following some instructions from a blog by Mischa Taylor. I've installed VirtualBox (4.2.20), a "sane" Ruby environment (with the DevKit) and the berkshelf gem and that went fine as well but whenever I issue the
> vagrant plugin install vagrant-berkshelf
The command returns an error when trying to build the
Installing the 'vagrant-berkshelf' plugin. This can take a few minutes...
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/ext/builder.rb:62:in `run':
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
C:/HashiCorp/Vagrant/embedded/bin/ruby.exe extconf.rb
C:/HashiCorp/Vagrant/embedded/bin/ruby.exe: invalid option -J (-h will show valid
options) (RuntimeError)
Gem files will remain installed in C:/Users/user_me/.vagrant.d/gems/gems/hitimes-
1.2.1 for inspection.
Results logged to C:/Users/user_me/.vagrant.d/gems/gems/hitimes-1.2.1/ext/hitimes/c/gem_make.out
from
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:39:in `block in build'
if I issue
> gem install hitimes
that works fine, so the problem seems to be in the extension builder that Vagrant uses. I don't have alot of experience working with Ruby I was just wanting to start learning to use chef and berkshelf with vagrant.

This may be due to the version of Ruby
try rvm to manage your ruby environments, download ruby 1.9.3 through rvm
then
rvm use 1.9.3
vagrant plugin install vagrant-berkshelf

Related

Failing to Debug Vagrant source code with RubyMine 2016.1

I am new to Ruby and Gems, Bundler, RVM, etc. although I have been a programmer for many years, including the past 5+ on PHP with PhpStorm.
I want to write a Vagrant Plugin so I wanted to set up debugging with RubyMine 2016.1 for Vagrant without modifying the source code However after hours and hours of trial and error I feel like I am just running around in circles.
I installed RVM and ran rvm install 2.3.0 then rvm use 2.3.0 and then tried to install this gem:
gem install ruby-debug-base19x --pre
And it would fail with these and several other errors:
ERROR: Error installing ruby-debug-base19x:
ERROR: Failed to build gem native extension.
current directory: /Users/mikeschinkel/.rvm/gems/ruby-2.3.0/gems/ruby-debug-base19x-0.11.31/ext/ruby_debug
/Users/mikeschinkel/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160513-39119-13cpfzr.rb extconf.rb
Ignoring debase-0.2.2.beta7 because its extensions are not built. Try: gem pristine debase --version 0.2.2.beta7
So I installed RVM and ran rvm install 1.9.3 then rvm use 1.9.3 and then the following ran without error:
gem install ruby-debug-base19x --pre
gem install ruby-debug-ide --pre
Then I go to Debug and I see this pop-up:
If I select yes there is a status dialog that appears to be trying to install these:
.../ruby-debug-base19x-0.11.31.gem
.../ruby-debug-ide-0.6.1-beta2.gem
After which RubyMine displays this error:
Error running Vagrant Up:
Cannot start debugger. Gem 'ruby-debug-ide' isn't installed or its executable script 'rdebug-ide' doesn't exist
If I try to debug again it just runs me through the same popup-install-then-error loop.
BTW, here is my Run/Debug Configuration:
P.S. The Vagrant .gemspec specifies >= 2.0.0 Ruby so I am worried that even if I can get it fixed RubyMine debugging won't work with, but hopefully not:
s.required_ruby_version = ">= 2.0.0"
Thanks in advance for any help.
-Mike

Can't install Vagrant 1.0.4 with gem

I'm trying to install Vagrant 1.0.4 with gem but it's not working for me and I can't think of a fix. I enter this prompt and I get the following message:
gem install vagrant -v 1.0.4
Building native extensions. This could take a while...
ERROR: Error installing vagrant:
ERROR: Failed to build gem native extension.
I am restricted to using Ruby 1.8.7 in this environment, and also Vagrant 1.0.4.
The log is huge so I'm putting it on Pastebin.
Thanks.

Using chef-metal with Windows-7

I want to use chef-metal with on my windows workstation. Following are details of my setup :
OS : Windows 7, 32-bit
Chef client version : 11.12.0
I follow the instructions as mentioned here . I intend to use the Vagrant driver for chef-metal, so I have vagrant and virtualbox installed on my system. Next as the documentation says, I install 'chef-metal' gem, and then try to run the basic vagrant_linux and simple recipes. But the setup is giving me rubygems conflicts for gem 'ffi', the error is shown in the screenshot below :
Apparently, installing chef-metal gem is messing up my chef-client installation also. If I run chef-client -v, just to check if chef-client is working fine, i throws the same gem conflict error.
While installation of chef-metal gem, I observe that it is installing certain gems, that are already installed on the system(with the chef-client installation.) I tried to uninstalling a version of the gem throwing the error(ffi-1.9.3-x86-mingw32), but it showed me this info:
Same is the response i get when i try to uninstall ffi-1.5.0-x86-mingw32 gem.
Update :
As per Tensibai's suggestions, I removed teh older version of the gem and updated to use a new one. Following is the new gem dependency error I get :
Please help as I have reached a dead end on searching a solution for this one:
Gem documentation is HERE
To uninstall it is gem uninstall ffi -v 1.5.0
What the errors tells you is that it can't load it because ffi is in versino 1.5 and ohai require it in a version around 1.9.X (the ~> 1.9).
You best bet to resolve the problem is to run a gem update ffi -v 1.9.3
And update chef too to remove old depending: gem update chef

Error while installing watir-webdriver on Ubuntu 11.10

After going step by step (installed both ruby and rubygems properly) to install watir-webdriver, I am facing following error:
ERROR: Error installing watir-webdriver:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mkmf (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from extconf.rb:4:in `<main>'
Please help me resolve this and do let me know what made this happened?
Not sure how you are installing ruby on your Ubuntu machine but may I recommend the Ruby Version Manager.
https://rvm.io/
this will allow you to install different versions of ruby on your machine and switch between them as well as gems etc.
here is a quick guide I wrote for installing watir webdriver in Ubuntu via RVM:
Ubuntu requires the use of a Ruby Version Manager. To do this we will need to first install both the Curl package and Git-core.
To do this use the following command:
sudo apt-get install curl git-core
Upon success we will need to download the Ruby Version Manager application. This application allows us to install multiple versions of ruby as well as switch between. It also provides a Gem manger. Recommended to Google to read up on the commands and features within RVM. To install RVM use the following:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
We can also install packages within RVM and we will require the use of openSSL:
rvm pkg install openssl
Then installing Ruby itself:
rvm install 1.9.3-p125 --with-openssl-dir=$rvm_path/usr
Best to test this is all working with:
irb
When all clear we can install the Gem, we need to install it within the RVM with the follow:
rvm do gem install watir-webdriver
If installed correctly we should be able to use watir to drive firefox which is already installed on ubuntu.
I am not Linux/Ubuntu expert but the error message says you do not have build tools installed.

Using RubyGems on ubuntu server

I have installed Ruby on Rails on my Ubuntu 10.04 Server by official tutorial: https://help.ubuntu.com/10.04/serverguide/C/ruby-on-rails.html
But I have some troubles with it. Please, help me!
1) I can't install ANY gem!
sudo gem install sqlite3-ruby
returns
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native
extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:3:in `require': no such
file to load -- mkmf (LoadError) from
extconf.rb:3
Gem files will remain installed in
/var/lib/gems/1.8/gems/sqlite3-1.3.3
for inspection. Results logged to
/var/lib/gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out
2) When i'am trying to get Rails version by command
rails -v
Server prints:
getopt: invalid option -- 'v'
Terminating...
If you are not set on using the packages in the Ubuntu repos(and I see no reason why you'd be), I'd suggest following this guide:
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you
Consider going through and making sure your sqlite3 libraries are installed. It looks as though you may be missing the required dependencies to build your gem. In this case you might try running this before installing your gem:
sudo apt-get install libsqlite3-dev
Also, try
rails --version
instead.

Resources