Failing to Debug Vagrant source code with RubyMine 2016.1 - ruby

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

Related

Unable to install bcrypt-ruby, blocks upgrade of devise, "Failed to build native gem extension"

I'm on Mac OSX 10.10.2. In attempting to upgrade devise from 2.1.2 to 2.2.8 (by updating the version in the Gemfile), bundle install attempts to install bcrypt 3.1.10 and crashes with this output:
/Users/username/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb
creating Makefile
make clean
make
compiling bcrypt_ext.c
make: *** [bcrypt_ext.o] Segmentation fault: 11
make failed, exit code 2
I have attempted some fixes found in searching, such as:
`gem install bcrypt -v '3.1.10'ยด
(same error)
Download gem source from github (https://github.com/codahale/bcrypt-ruby) and attempt to install from the local gemfile (same error).
Uninstall bcrypt-ruby with gem uni bcrypt, reinstalling with gem i bcrypt-ruby --platform=ruby (same error)
If I set user to root with sudo su -, I am able to run the install with the following output:
root# gem install bcrypt -v '3.1.10'
Building native extensions. This could take a while...
Successfully installed bcrypt-3.1.10
Parsing documentation for bcrypt-3.1.10
unable to convert "\xCA" from ASCII-8BIT to UTF-8 for lib/bcrypt_ext.bundle, skipping
1 gem installed
However, if I exit out of root, bundle install still fails.
Running rvm 1.25.3, ruby 1.9.3, gem 2.2.2, Bundler version 1.9.4, Xcode 6.3, Command Line Tools 6.3
Any ideas?
Finally, this worked:
Updating RVM to head with rvm get head
Uninstall rvm 1.9.3 with rvm uninstall 1.9.3
Re-install rvm 1.9.3. Tried running rvm install 1.9.3, which advised to run rvm install ruby-1.9.3-p551 instead. Did that.
rvm use 1.9.3
Reinstalled bundler with gem install bundler
Now, finally bundle install works.
It seems likely that previous steps (particularly running updates on Xcode & Command Line Tools) have contributed to success.

Errors Installing vagrant.berkshelf

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

bcrypt-ruby won't install with bundler but works fine with gem install

I just recently began having trouble with bundler - bcrypt-ruby will not install when doing a bundle install or sudo bundle install and exits with the following error:
Installing bcrypt-ruby (2.1.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
Gem files will remain installed in /home/deploy/vendor/bundle/ruby/1.8/gems/bcrypt-ruby-2.1.4 for inspection.
Results logged to /home/deploy/vendor/bundle/ruby/1.8/gems/bcrypt-ruby-2.1.4/ext/mri/gem_make.out
An error occured while installing bcrypt-ruby (2.1.4), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '2.1.4'` succeeds before bundling.
However, gem install bcrypt-ruby -v '2.1.4' runs just fine (and in fact has already been run on this box). Running /usr/bin/ruby1.8 extconf.rb manually works just fine, and the resulting Makefile also runs with make just fine.
I'm using Ruby 1.8.7 and bundler 1.0.21 on Ubuntu 10.04.1 LTS. Other gems seem to be working fine through bundler. Though this is probably obvious, I've confirmed that the ruby-dev, gcc, etc packages are installed. I've tried using the --deployment option with bundler with no different behavior. The only thing I can think that has changed recently is I did a bundle update a couple days ago, so bundle got a minor version change (1.0.10 -> 1.0.21) and bcrypt appears to have gotten a major version change (2.1.4 -> 3.0.1).
Any help is appreciated!
Have you upgraded to Lion since you installed Ruby 1.9.2? If so it is probably linked to the wrong gcc.
Try uninstalling and reinstalling 1.9.2, I would suggest using rvm
rvm uninstall 1.9.2
rvm install 1.9.2
If that does not work you might have to implode rvm
rvm implode
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
source ~/.bash_profile
rvm install 1.9.2
try:
sudo apt-get install build-essential

gem install capistrano failure

I tried to install the package "capistrano" on a linux box but got the following error:
*** buffer overflow detected ***: /usr/bin/ruby terminated
Additionally it showed me a list of the memory map and then the install process was aborted.
Any idea on what causes this error?
Cheers
Roland
I had similar issue when installing Capistrano on CentOs 6.7, Ruby 1.8.5, gem 1.3.1. Turns out the issue was caused by newest highline package.
The following allowed me to install capistrano correctly:
gem install highline --version "=1.6.2"
gem install capistrano --version "=2.6.0"
This error may be related to some Ruby 1.8.6 bugs (see this post http://opsrealism.tumblr.com/post/4931621276/mirroring-rubygems-and-ruby-9-2-on-centos-5-5 for some more details), so you may try to upgrade your Ruby to 1.8.7, if it's possible.
Another option is to try to install a bit older version of gem - it worked for me on a couple of occasions, where exact gem versions didn't matter. For example,
gem install capistrano --version "=2.7.0"
might work.
I'm running:
Centos 5.5
Ruby 1.8.5
Gems 1.3.1
I narrowed the problem down to the highline gem. Although I attempted to intall all of its dependencies manually (which worked), it still failed to load itself unless I followed the above advice and specified the version, 1.6.2. =(
gem install highline --version "=1.6.2"
Hopefully, I'll be migrating off of this ancient OS soon.
I had similar issues installing cap for CentOS 5.8 but it worked using the rvm installer (to upgrade to latest ruby, I used 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux])
What I d
I yum remove ruby (to get rid of 1.8.x)
I followed simple instructions at https://rvm.io/rvm/install/ for installing rvm
gem install capistrano
cap command is found!
Hope this helps someones

Installing Sproutcore with RubyGems fails at the haml gem

I am trying to install sproutcore on a windows xp vm (virtualbox), for development, using RubyGems. When gems reaches haml-3.0.25.gem it stops with the error:
gem install sproutcore -V
...
ERROR: While executing gem ... (Zlib::DataError)
invalid stored block lengths
I have tried both Ruby 1.8.7 and 1.9.2 as well as RubyGems 1.7.1 and 1.8.1.
I tried downloading haml 3.1.1 with git and installing it manually, but the rake would not install. It said something about 'lib/haml' not found. The directory did exist.
Other gems install just fine under all the combinations I tried. I even tried installing it under my host OS (Win 7 32-bit), but it gave the same error. Installing haml by itself changes the error message only slightly:
gem install haml -V
...
ERROR: While executing gem ... (Zlib::DataError)
invalid code lengths set
Zlib compresses and decompresses data streams from what I have read, so it sounds like the haml gem might be corrupt (although I doubt).
I am at my wits end and could find no helpful advice anywhere.
Special thanks to #saner for his contribution. After a lot of frustration, this is how I finally installed sproutcore on a Windows XP VM running on a Windows 7 host.
1) Download and install Ruby 1.9.2-p180 (remember to tick the option to include the bin directory in the PATH variable).
2) Download DevKit 4.5.1 and extract it.
3) Open a command prompt and cd to the extracted directory.
4) Run:
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install
5) Download RubyGems 1.7.2 and run setup.rb
6) From the command prompt run
gem install haml -v 3.0.24
gem install eventmachine --pre
gem install sproutcore --pre
Thats it.
Enjoy.
I was able to install SproutCore on Ruby 1.9.2:
Install Ruby 1.9.2-p180
gem install sproutcore --pre
gem install eventmachine --pre
gem uninstall thin
gem install mongrel
I needed to remove thin because starting sc-server ended with errors, SproutCore will use mongrel instead of thin.
Update:
I didn't mention that I use RubyGems 1.7.2 and I have installed DevKit and Cygwin.
I removed all versions of SproutCore, Mongrel and Haml, then I typed:
gem install sproutcore --pre, SproutCore v1.6.0.beta.1 was installed.
eventmachine --pre, eventmachine (1.0.0.beta.3 x86-mingw32) was installed
SproutCore works with this setup, using mongrel was not necessary.
My configuration: sproutcore (1.6.0.beta.1), ruby 1.9.2p180, gem 1.7.2, thin (1.2.11 x86-mingw32), eventmachine (1.0.0.beta.3 x86-mingw32), haml (3.0.25), gcc version 4.5.0 (GCC)
I know this is a really old question, but since I just experienced the same problem, I've decided to add my insights on it.
So, it happened while I was trying to install the same set of gems on two different machines with different architectures, with different locations and respectively in different networks. I.e. - my home mac and a remote linux server.
So, one particular gem (dm-sqlite-adapter) failed installing on both machines, and I even tried it couple of times, but always with the same result:
$ gem install dm-sqlite-adapter
ERROR: While executing gem ... (Zlib::DataError)
invalid code lengths set
Then I spent few minutes browsing the network for a solution, including reading this thread.
Since I didn't find any satisfying answer and I wasn't pleased with the idea of reinstalling everything, decided to act dumb and tried gem install one more time.. And it worked. Then tried the other machine - worked like a charm.
So as a conclusion I'd just guess that the problem came from the remote repo and maybe the gem hadn't even downloaded at all (I forgot to check that prior to succeeding installing it). But as I said - it's just a guess..

Resources