Is pry available in nitrous.io? - ruby

I would like to use pry while debugging Ruby code in nitrous.io. I updated RubyGems, but still cannot use it. Is it available in nitrous.io? How can I add it to my gems?

Have you tried to install it in the console by writing
gem install pry
or if you're trying to do rails
gem install pry-rails
because for me it worked perfectly, I had to close the console once and open a new one before it worked. I hope this helps

Related

Rubymine debugging

I have Installed
2017.1.5 Version of Ruby
ruby-2.4.1-p111
I've made a new project and named it hello.rb. When I run it, everything works fine. However when I try to debug the project I get a prompt message
The gem debase required by the debugger is not currently installed. Would you like to install?
Error running hello. Following gems were not installed:
I've tried re-installing everything and restarting and I don't know what is the problem.
Well apparently debugger in RubyMine does require this gem. So You have multiple ways of doing this.
Assuming your File > Settings > Languages & Frameworks > Ruby SDK and Gems
contains only one ruby version and its the selected one (and the gem really isn't in the list). As halfelf said in your terminal/cmd/iterm you would simply write
gem install debase
Also you could create file called Gemfile that would have all the gems in
source 'http://rubygems.org'
gem 'debase'
and in the future any other gems you would need, Rubymine should be able to install those for you.
If you would have already installed the gem, there might be a gem installation conflict that would need to be resolved.

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.

How do you install pry plugins?

I've read about these great pry plugins (e.g. pry-debugger, pry-stack_explorer), but after nearly 30 minutes of searching, I can't find any documentation on how to install them. I've gone to their github site, the pry wiki and read/watched several tutorials, but there's nothing in there about installation.
Every pry plugin that start with pry- are auto-loaded. You just need to gem install pry-name.
Here is the link about plugins(creating plugins too) and exact quote:
A valid Pry plugin is a gem that has the pry- prefix (such as the
pry-doc gem)
If a Pry plugin is installed (i.e a gem with the pry- prefix is
installed) it will be loaded automatically when a session starts.
Note: pry has special command gem-install gem_name. You should use that command instead of .gem install gem_name in order to work. This (pry)command install and(!) reload gem cache.
If that won't work try installing gems from console then running pry.
ps. you can check installed plugins via pry --installed-plugins(in console) or in pry just type help and it will show you available commands.

Why does ri not show TCPSocket class?

I am trying to search TCPSocket ruby class documentation with ri but it shows nothing. Most of the gems are shown. I am using rvm, and require 'socket' works perfectly. How to fix this?
Try using:
gem rdoc --all
The documentation says:
--all Generate RDoc/RI documentation for all
installed gems
You can find these things out by typing:
gem help
or
gem help rdoc
at the command line.
You might want to throw on --overwrite to overwrite existing documentation.
Old versions of Ruby, around 1.8, didn't always have the core and/or std-lib documentation generated. There's a gem you can install that patches that, but I don't remember what it was right now.

What is the easyest way to use gems in a macruby application, in XCode?

I need to include a rubygem in a simple macruby application i am creating in XCode. Using require 'rubygems' does not give an error, but the next line to require any other gems has a load error. I installed the gems using macgems. Thanks in advance.
The load error might be an indication that the gem doesn't work on Macruby. Post the error and someone might have more info on that gem or that error.
Did the gem actually install correctly? If it did install, does it work from the command line? Try creating a simple script that requires rubygems and your gem and run that on the command line outside of xcode and see if the problem is compatibility with that gem.
A while back in the 0.5 days I had this problem with a gem (miniexif iirc) that would install via macgems but not load or run. This might be a similar problem.

Resources