Error Running Ruby Debug IDE with Rails 4 app - ruby

I am having a problem running a Rails 4 app with Ruby Debug IDE using Visual Studio Code. This is the error I get.
/home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing'
: undefined method `this' for #<Gem::Specification:0x1271b08 debase-0.2.1> (NoMethodError)
from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
from /home/ziyan/.rvm/gems/ruby-2.3.0#tbv_website/gems/debase-0.2.1/lib/debase.rb:4:in `<top (required)>'
from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /home/ziyan/.rvm/gems/ruby-2.3.0#tbv_website/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:8:in `<top (required)>'
from /home/ziyan/.rvm/gems/ruby-2.3.0#tbv_website/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in `require_relative'
from /home/ziyan/.rvm/gems/ruby-2.3.0#tbv_website/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in `<top (required)>'
from /home/ziyan/.rvm/gems/ruby-2.3.0#tbv_website/bin/rdebug-ide:23:in `load'
from /home/ziyan/.rvm/gems/ruby-2.3.0#tbv_website/bin/rdebug-ide:23:in `<main>'
from /home/ziyan/.rvm/gems/ruby-2.3.0#tbv_website/bin/ruby_executable_hooks:15:in `eval'
from /home/ziyan/.rvm/gems/ruby-2.3.0#tbv_website/bin/ruby_executable_hooks:15:in `<main>'
Extra details
Ruby 2.3.0
Ruby Debug IDE 0.6
IDE: Visual Studio Code + vscode-ruby
Different variations tried
Tried updating to Ruby 2.3.3
Tried downgrading ruby-debug-ide to 0.5
Tried upgrading ruby-debug-ide to 0.6.1.beta4
With no success
Extra
I started a new Rails 5 + Ruby 2.4.0 project and debugging works fine with it. It uses the same ruby-debug-ide version. So the version of ruby-debug-ide should be working.

I just solved the issue by updating rubygems to version 2.6.11 (I think it's the latest version available as of today).
$ gem update --system
Now debugging in VSCode works again.
My current config.
CentOS 7
RVM, latest stable
VSCode, latest stable with Ruby extension 0.10.4
Rails 4 - Ruby 2.3.3 (currently working on a Solidus-based e-commerce)
Debase 0.2.1, Ruby-Debug-IDE 0.6.1b4
I hope this will help you.

Related

capistrano suddenly stopped working

i'm using a ubuntu vagrant box with installed capistrano to develop an application.
when i tried to deploy i get the following error:
/usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:152:in `require': no such file to load -- capistrano/ext/multistage (LoadError)
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:152:in `require'
from ./config/deploy.rb:3:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from Capfile:4:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/vendor_ruby/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `load_recipes'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `each'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:65:in `load_recipes'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:31:in `execute!'
from /usr/lib/ruby/vendor_ruby/capistrano/cli/execute.rb:14:in `execute'
from /usr/bin/cap:4
as google suggested i tried to reinstall capistrano, but this failed because of dependencies(net-ssh requires ruby >= 2.0)
so i installed net-ssh v2.9.2
sudo gem install net-ssh -v 2.9.2
Fetching: net-ssh-2.9.2.gem (100%)
Successfully installed net-ssh-2.9.2
1 gem installed
but now the next dependency error occures...
How do i make a fresh installation of capistrano working?
do i need a newer version of ruby(apt-get install ruby tells me that the newest version is already installed)?
Or is the cause of this error something complete different?
I can't see anything in your trace about what version of ruby you're on, but you did say "net-ssh requires ruby >= 2.0", so you might need a newer version of ruby like you said. You can check the version of ruby you're using with ruby -v. I would also recommend using a version manager so that you can use multiple versions between projects. I find RVM or rbenv to be good starting points.
OK, this is strange...
after running vagrant provision multiple(~5) times and installing/deinstalling multiple gems and ruby versions the next "vagrant provision" fixed the problem magicaly. i still dont know why this error occured and what fixed it, bull i'll close this question...

Appium: Nokogiri giving load error while running test case

I have upgraded Ruby version to 2.1.0 from Ruby 1.8.7 and installed all dependencies to run a sample Appium test case using Ruby. But I am facing an issue to load nokogiri while running a test case.
I am using
OS: Mac OS - 1.9.2
Ruby: 2.1.0
Appium: 1.2.0
Nokogiri: 1.6.3.1
This works fine on Ruby: 1.8.7.
Error:
Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/nokogiri-1.6.3.1/lib/nokogiri.rb:29:in `require': dlopen(/Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/nokogiri-1.6.3.1/lib/nokogiri/nokogiri.bundle, 9): Library not loaded: /Users/.rvm/rubies/ruby-2.1.0/lib/libruby.2.1.0.dylib (LoadError)
Referenced from: /Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/nokogiri-1.6.3.1/lib/nokogiri/nokogiri.bundle
Reason: image not found - /Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/nokogiri-1.6.3.1/lib/nokogiri/nokogiri.bundle
from /Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/nokogiri-1.6.3.1/lib/nokogiri.rb:29:in `rescue in <top (required)>'
from /Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/nokogiri-1.6.3.1/lib/nokogiri.rb:25:in `<top (required)>'
from /Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/appium_lib-4.1.0/lib/appium_lib/driver.rb:4:in `require'
from /Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/appium_lib-4.1.0/lib/appium_lib/driver.rb:4:in `<top (required)>'
from /Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/appium_lib-4.1.0/lib/appium_lib.rb:28:in `require_relative'
from /Users/.rvm/gems/ruby-2.1.0/ruby/2.1.0/gems/appium_lib-4.1.0/lib/appium_lib.rb:28:in `<top (required)>'
from /Users/Documents/rslRuby/li_workspace/flagship_native_tests/UITestFramework/selenium/base/LI_framework.rb:32:in `require'
from /Users/Documents/rslRuby/li_workspace/flagship_native_tests/UITestFramework/selenium/base/LI_framework.rb:32:in `<top (required)>'
from /Users/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from samle_tests/sign_in_test.rb:10:in `<main>'
Possible Fix 1:
This usually happens when gems are linked wrong, i recommend trying to re-install ruby via rvm.
rvm reinstall 2.1
rvm use 2.1
Make sure all the gems are up to date by running(in your apps directory)
bundle install
Possible Fix 2:
Another common problem is to install rvm as a root user, if you've done this re install rvm.
You can uninstall rvm by running
rvm implode
Follow the steps on the website to install rvm

nanoc installation setup in Linux

I'm a newbie to Ruby. Trying to setup nanoc in my machine. I'm running Ubuntu 14.04.
After the nanoc installation, when I type
$nanoc --version
I get the following errors:
/home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler/shared_helpers.rb:24:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:248:in `default_gemfile'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:192:in `root'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:99:in `bundle_path'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:400:in `configure_gem_home_and_path'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:90:in `configure'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:151:in `definition'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:116:in `setup'
from /home/ananth/.rvm/gems/ruby-head#global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /home/ananth/.rvm/gems/ruby-head/gems/nanoc-3.7.0/bin/nanoc:7:in `<top (required)>'
from /home/ananth/.rvm/gems/ruby-head/bin/nanoc:23:in `load'
from /home/ananth/.rvm/gems/ruby-head/bin/nanoc:23:in `<main>'
from /home/ananth/.rvm/gems/ruby-head/bin/ruby_executable_hooks:15:in `eval'
from /home/ananth/.rvm/gems/ruby-head/bin/ruby_executable_hooks:15:in `<main>'
Am I missing something from my rvm? Anything to do with $PATH, .bashrc or .bash_profile?
Thanks for the help in advance!
This is a bug in 3.7.0 that will be fixed in 3.7.1.
3.7.0 unintentionally requires a Gemfile to be present when Bundler is installed.
To avoid this bug, either temporarily switch back to 3.6.11, or use a Gemfile (I recommend the latter).

Rolify gem is not working with Rails 3.2.13

I am using rails 3.2.13. Before adding rolify into my gemfile the app is working fine. After adding the gem in gem file and run the bundle command, my app is not working it raises the following issue:
ruby-1.9.2-p320#roles/gems/railties-3.2.13/lib/rails/initializable.rb:13:in `[]': can't convert Symbol into Integer (TypeError)
from /home/.rvm/gems/ruby-1.9.2-p320#roles/gems/railties-3.2.13/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
This is the problem with rolify 3.3.0 version gem. If anyone want to use rolify, use below 3.3.0 version presently 3.2.0 is available otherwise it brakes your bones. :)

Ruby on Windows: uninitialized constant Process::Functions::FFI (NameError)

I'm running ruby on windows, having installed 1.9.3 via the ruby installer. I've installed the chef ruby gem, but I cannot use chef-client or knife from the command line.
Here's the abridged output from the command line. What's going wrong?
C:\>chef-client
C:/ruby193/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:4: Use RbConfig instead of obsolete and deprecated Config.
C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/windows/core_ext.rb:31:in `<module:Functions>':
uninitialized constant Process::Functions::FFI (NameError)
from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/windows/core_ext.rb:30:in `<top (required)>'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout/windows.rb:26:in `<top (required)>'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
from C:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout.rb:33:in `<class:ShellOut>'
from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout.rb:26:in `<module:Mixlib>'
from C:/ruby193/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.2.0/lib/mixlib/shellout.rb:24:in `<top (required)>'
P.s. version numbers:
C:\>ruby -v
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]
C:\>gem -v
2.1.8
If you're using Chef 11.6.2 (latest release) you might want to downgrade to 11.6.0. 11.6.2 uses mixlib-shellout, but unfortunately only 1.1 and it's got a really low version of the FFI dependency. Downgrading to 11.6.0 should fix this for the moment, and their master branch is using mixlib-shellout 1.2 now so it should get fixed soon....

Resources