Comments (12)
To provide more details, this happens only if I run iruby notebook
in a directory apart from where my iruby has been cloned. (/home/sameer/gitrepos/iruby/
in my case).
from iruby.
Any ideas on this? I'm unable to run iruby notebook anywhere but in the directory of cloned iruby code.
from iruby.
Some problem with the $LOAD_PATH
It seems you are running from the gem and not the cloned iruby repository. Also bundler could be an issue since the kernel tries to load the current Gemfile by requiring bundler/setup
from iruby.
ruby load path management, gems, bundler - this is really a mess
from iruby.
Remember to always do a iruby register --force
if you change the location of the iruby command.
I tested the following cases:
- WORKS - Running cloned iruby from a cloned iruby directory
- WORKS - Running cloned iruby from a different repository
- WORKS - Running iruby gem from a directory without a Gemfile
- WORKS - Running iruby gem from a directory with a Gemfile requiring iruby
- FAILS - Running cloned iruby from a directory with a Gemfile NOT requiring iruby or at least the iruby dependencies, e.g. rbczmq
- FAILS - Running iruby gem from a directory with a Gemfile NOT requiring iruby
_NOTE: The FAILS are by design of bundler, add iruby to the Gemfile to fix it_
from iruby.
My problem is covered in the last two cases that you report as failed.
Also try to require 'statsample'
, or any gem that is not listed in the gem file. it should fail.
Currently to make a few notebooks I'm adopting a hack where I run ./iruby notebook
from iruby/bin
after having added the following to my Gemfile:
gem 'statsample'
gem 'daru'
from iruby.
The two last failures are known "issues", but they are by design. If you want to use iruby from a project with a Gemfile, you have to require iruby in it.
I recommend the following Gemfile:
source 'https://rubygems.org/'
# Your project gems
gem 'statsample'
gem 'daru'
...
# Gems only needed if we want to use iruby
group :iruby do
gem 'iruby'
gem 'pry'
...
end
from iruby.
But why should it be this way?
If the browser based notebook is meant to be a more enhanced and interactive version of the pry or irb shells, should I not be able to do the same things that I do in the shell; in iruby?
So for instance we don't need to bother about the directory location when running pry
or irb
. Why not keep it like that here?
And if you're planning to keep this design I think it should be well documented. I spent quite a while trying to figure this out.
from iruby.
Well, this is by design of bundler. If we use it, this is what we get. iruby just loads a Gemfile if available by require 'bundler/setup'
.
I see it this way - there are three cases:
- You don't use bundler - then there is no Gemfile. This is done for example in those docker images, all gems are just installed as root. There won't be any problems.
- You use bundler in your project. There is a Gemfile, it should be loaded. The Gemfile should mention iruby since you want to use it.
- You want to use bundler PARTIALLY, there is a Gemfile which you probably expect to be loaded. But the Gemfile doesn't mention iruby. So this fails.
I think the 3. case is what you are currently in and complaining about. I don't know if there is a way around it.
I also wasn't happy with bundler in the beginning, because I also wanted to use gems that were not part of the Gemfile. This is not allowed by the design of bundler, because bundler ensures that no wrong gems and versions are loaded. Therefore use it right and mention ALL gems that are used including iruby.
Those things also apply to pry. For irb not so much since it is always there as part of the stdlib.
from iruby.
Would you consider using hen instead of bundler?
rb-gsl currently uses it.
from iruby.
Hen is a helper providing rake tasks and not really a replacement for bundler.
Am 4. Juni 2015 07:55:47 MESZ, schrieb Sameer Deshmukh [email protected]:
Would you consider using hen instead of bundler?
rb-gsl currently uses it.
Reply to this email directly or view it on GitHub:
#31 (comment)
from iruby.
@minad @v0dro can you help me with my error: http://stackoverflow.com/questions/35999925/kernel-dies-when-creating-iruby-notebook/ ?
from iruby.
Related Issues (20)
- iruby.rb should perform `require "iruby/logger"` HOT 1
- SVG images do not show up
- Release 0.7.0
- self no longer works with PlainBackend HOT 7
- google colab not working HOT 6
- iruby does not install/work with Ubuntu snap install of ruby? HOT 3
- Shutdown takes 5 seconds per kernel HOT 3
- Pry breaking point/code navigation behavior in Jupyter HOT 1
- Suggestion: to_iruby should take precedence over other display methods HOT 5
- Support connecting to running rails server session
- Module Import in a Notebook HOT 1
- Issue with iruby while using asdf-vm as the version manager? HOT 7
- Using IRuby.input or IRuby.form hangs Kernel HOT 5
- [Nuisance issue] Using Gnuplot prints correct graph, also throws error HOT 8
- Can a standard class method be overridden in Jupyter/Iruby? HOT 2
- .irbrc file not loaded HOT 1
- Issue with ipython and/or vscode? HOT 2
- Can't add a method to String class in Jupyter-lab HOT 2
- Autoindent not working properly in Jupyter-lab notebook HOT 1
- How to inline an image in a jupyter-labnotebook ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iruby.