Cannot use ruby-debug19 with 1.9.3-p0? [duplicate] - ruby

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Rails 3.1 and Ruby 1.9.3p125: ruby-debug19 still crashes with “Symbol not found: _ruby_threadptr_data_type”
I run this:
gem install ruby-debug19
And in my cucumber env.rb file, I have this:
require 'ruby-debug'
When I try to run, though, I get this exception:
/home/skendall/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_current_thread - /home/skendall/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so (LoadError)
What do I need to do to get ruby-debug to work with 1.9.3-p0?

UPDATE: ruby-debug19 is not maintained anymore. This question and my answer have become irrelevant, it's far easier to use the 'debugger' gem instead.
See Debugging in ruby 1.9
I also ran into this, and found the solution in Ruby 1.9.3 and ruby-debug. You need to install not-yet-officially-released versions of ruby-debug-base19 and linecache19. The currently released versions indeed cause the exception you had.
Use this gist.
#To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883
linecache19-0.5.13.gem
ruby_core_source-0.1.5.gem
ruby-debug19-0.11.6.gem
ruby-debug-base19-0.11.26.gem
#Then in your console
export RVM_SRC=/your/path/to/ruby-1.9.3
# Note, your source path should be something like /home/user/.rvm/src/ruby-1.9.3-p0
gem install archive-tar-minitar
gem install ruby_core_source-0.1.5.gem -- --with-ruby-include=/$RVM_SRC
gem install linecache19-0.5.13.gem -- --with-ruby-include=/$RVM_SRC
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/$RVM_SRC
gem install ruby-debug19-0.11.6.gem -- --with-ruby-include=/$RVM_SRC

This is a known bug. There's reportedly some work arounds here, here and finally here.

If the workarounds are annoying and/or impossible due to your rvm/bundler setup, which is the case with me, consider pry, and optionally the pry-debug plugin. Pry might be a more generally useful tool than ruby-debug anyways.

Related

Ruby Gems suddenly stopped working on ubuntu 12.04

After a couple of days of not doing pretty much anything on the ubuntu box, I decided to try out some ruby stuff. For this, I wanted to fire up pry. Unfortunately, I was presented with
Sorry, you can't use Pry without Readline or a compatible library.
Please gem install rb-readline or recompile Ruby --with-readline.
~/.rbenv/versions/2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require': libreadline.so.5: cannot open shared object file: No such
file or directory -
~/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-linux/readline.so
(LoadError)
Being quite new to linux in general, I figured I'd just do as it said, and install this rb-readline. The installation passes just fine, but doesnt seem to do anything at all. If I do gem list p, the package just doesn't appear.
So yeah, I just don't know what to do to get it working again, and the only thing I managed to find by searching was related to an installation without rbenv and had something to do with sudo etc.
Any ideas?
Without understanding the problem and following the advice in option 2 of the message:
Sorry, you can't use Pry without Readline or a compatible library.
Possible solutions:
* Rebuild Ruby with Readline support using `--with-readline`
* Use the rb-readline gem, which is a pure-Ruby port of Readline <==== Option 2
* Use the pry-coolline gem, a pure-ruby alternative to Readline
I added the gem into the Gemfile (as follows), bundled and pry was then available.
group :development, :test do
gem 'pry'
gem 'rb-readline'
end
I had this problem too. I am using rbenv and reinstalling ruby via
rbenv install -f 2.2.3
did fixed it for me. Of course you'd put in your respective version. -f forces the installation even though you already have that specific version installed. use rbenv global to find out what version you have installed and set.
I have some problem. But I don't want to add gem 'rb-readline'. So try it...
$ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
Do a sudo apt-get install libreadline-dev, seems like you're missing the readline shared library that pry is wanting. If it worked before, not sure why the library isn't there anymore.
I ended up doing rbenv uninstall, followed by rbenv install and re-installing all the gems, and got it back to working. Still no idea what caused it in the first place, but it works now.

toy/doc undefined method 'available?'

I'm attempting to build local Ruby documentation as suggested here:
https://github.com/toy/doc
However when I use the default Rakefile I get the following:
[Documentation]$ rake build
configuring and updating: 100.0%
rake aborted!
undefined method `available?' for Gem:Module
/Users/snowcrash/.rvm/gems/ruby-2.0.0-p195/gems/sdoc-0.2.20/lib/sdoc/json_backend.rb:9:in `<top (required)>'
Any suggestions?
I don't know much about ruby (and even less about the gem ecosystem built up around it), but I believe a possible workaround for this issue is to find what gems the project requires and manually install them. In the case of this particular project, it looks like you need the gem "fspath".
At the project root, type
gem install fspath
and try re-running rake.
I honestly don't know the actual root cause of the issue, other than that presumably, your version of the 'gem' program is probably > v2, while some other program (rake?) expects it to be older and still support the "available?" method.
If installing "fspath" doesn't fix the issue, you could try downgrading your version of gem by doing
gem install -v [some version of gem older than v2]
Check gem install --help for more info on this.
This is just for future visitor who has the same issue.
As ekremkaraca said, you can just solve this by downgrading rubygems.
rvm install --force rubygems 1.4.2

Ruby 1.9.2-p290 through rbenv produces warning from psych-1.2.1: VERSION and LIBYAML_VERSION

When I running ruby I get the following warnings:
~/.gem/gems/psych-1.2.1/lib/psych.rb:93: warning: already initialized constant VERSION
~/.gem/gems/psych-1.2.1/lib/psych.rb:96: warning: already initialized constant LIBYAML_VERSION
I've tried googling around but can seem to find a solution which makes me think it's specific to my system. Is there a way to fix this?
This problem seems to originate in psych being called by bundler in Bundler.setup. The work-around I used:
gem 'psych'
In my code before
Bundler.setup
There are two ways.
->First
add gem 'psych'
in your Gemfile file and then run
bundle install
-> Second
gem uninstall psych
at console

Having trouble installing Autotest in Rails in Ubuntu 10.10 enviroment

I'm learning how to program in Rails. I'm a complete newbie, and I'm learning from the screen-cast "Rails Tutorial: Learn by Example" by Michael Hartl.
I've been doing pretty well, until I've come to this obstacle, and I don't know how to figure it out. It's a bit frustrating to be frank, and I'd like to move forward with Rails & start making stuff :)
I installed RubyGems 1.8.5 by hitting:
$ gem update --system
and then installed ZenTest gem by hitting:
$ sudo gem install ZenTest
then I installed auto-test rails gem by hitting:
$ sudo gem install autotest-rails
and so got the message
Successfully installed autotest-rails-4.1.0
1 gem installed
Installing ri documentation for autotest-rails-4.1.0...
Installing RDoc documentation for autotest-rails-4.1.0...
So all was lookin' fine and dandy. I navigated to my app folder, and hit
$ autotest
and then got the message
/usr/local/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Could not find RubyGem ZenTest (>= 0) (Gem::LoadError)
from /usr/local/lib/ruby/1.9.1/rubygems.rb:219:in `activate'
from /usr/local/lib/ruby/1.9.1/rubygems.rb:1065:in `gem'
from /usr/local/bin/autotest:18:in `<main>'
I've tried searching for an answer to why this is happening, but I can't find any. Please help me solve this problem. I'd like to move forward with learning Rails :)
EDIT Maybe I should also mention that I have RSpec installed already -- I don't know if that's of any significance -- giving you a better understanding as to whats going on with my problem -- but I thought I'd just put it out there.
Cheers.
Are you using Rails 3+? If so look for a file called Gemfile inside the rails app root directory. Open it up, add:
gem 'ZenTest'
gem 'autotest-rails'
Save, exit and then run from command line:
bundle
After this try rerunning autotest
I'm at the same point of learning RoR (in this case RoR 3.0.3, Ruby 1.9.2p180, Ubuntu 11.04). I'm also stymied by the lack of consistency. In my case:
$ "You don't have i18n installed in my application. Please add it to your Gemfile and run bundle install".
Gemfile:
gem 'ZenTest'
gem 'autotest-rails'
gem 'i18n'
$bundle install => OK
$bundle show i18n => <ruby path>/gems/i18n-0.6.0
$autotest => (same result)
Any ideas? This is NOT going to help RoR adoption, if it's so obtuse to load a basic TDD environment. (I'll step off my soapbox now.)
try in command line "bundle install"

Rake failing to start

I'm having trouble understanding the following error with Ruby's Rake.
C:\>gem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
C:\>rake
C:/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find executable r
ake for rake-0.8.7 (Gem::Exception)
from C:/Ruby192/bin/rake:19:in `<main>'
Running Ruby 1.9.2 for Windows.
Edit: Installing from source yields:
C:\Documents and Settings\XPherior\Desktop\rake-0.8.7\rake-0.8.7>ruby install.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
ftools (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from install.rb:3:in `<main>'
The second error, where you have installed into C:\Documenets And Settings\ is occurring because you cannot install ruby into a folder with a space in the path. It should be installed into c:\Ruby\ c:\Ruby#.#.#\ if you want the version # in the path, or something along those lines.
for the first error: there is a bug in the rubyinstaller.org version of ruby 1.9.2, which is causing this by running "gem install rake".
you can read about the error you're getting, here: http://redmine.ruby-lang.org/issues/show/3677
there are a couple of ways to fix this error:
re-install ruby v1.9.2 and don't run "gem install rake". rake v0.8.7 is built into the ruby v1.9.2 installation, so you don't need to re-install it.
if you do want to manually install it, you can delete the ruby.gempspec file from your ruby installation. this file is located at (rubyinstalldir)\lib\ruby\gems\1.9.1\specifications
either of these options will fix the problem for you.
i'm not sure which is "better" off-hand... it may be necessary to delete the gemspec file and reinstall rake, to support updates and new versions in the future. i'm not sure, though. we'll find out once rake is updated and we need to install a new version. or, perhaps, the issue will be fixed in the ruby installation by then, and we'll just need to update our ruby install.
I've run into your both errors.
For the first one. Try the solution post at here http://betterlogic.com/roger/2010/11/ruby-1-9-2-rake-woe/.
And for the second error, it's causes by a library update by the ruby 1.9. From the Programming Ruby 1.9, "ftools have been removed (and replaced by fileutils)." I'm not pretty sure but at least that's an explanation.

Resources