You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Gnuplot in a regular Ruby application (which uses Bundler). When I require "gnuplot", that works fine (it returns true). Unfortunately, the Gnuplot constant does not exist.
One questioner on StackOverflow suggested it's due to gem require order (gnuplot needs to come before gsl). I've tried rearranging my Gemfile in every manner of order (bundler now requires in the user-specified order), but no luck.
How does one use the gnuplot gem when gsl is also being used?
+1, having the same problem. Works fine if I require gnuplot first in a non-rails and non Bundler managed script.
But as soon as Bundler or rails gets involved, the constant is 'missing'
Since there's been no reply from the author in three months, I'll go ahead and recommend you try out rubyvis or plotrb. Plotrb may be more appropriate for a Rails app.
As the OP said, it's somehow related to the GSL Gem.
So, this is probably not the correct forum.
Somehow the Namespace gets hidden so you can't refere to Gnuplot or GSL::Gnuplot because the RB GSL gem requires that Gnuplot be loaded first, which it is in my Gemfile, and the latest Bundler is supposed to respect that.
I need something like Gnuplot though, the other libs are fine for the Web App, but I'm running code in the Rails Environment, but not necessarily in a Rails App, so I need to be able to "see" my work from the Shell, which worked great when I was only in Ruby. But to access my Models, I needed to run my script as Rails run lib/script.rb
And now the Plot functions don't work, but as I said, it's a GSL problem.
Activity
ashrocket commentedon Sep 24, 2013
+1, having the same problem. Works fine if I require gnuplot first in a non-rails and non Bundler managed script.
But as soon as Bundler or rails gets involved, the constant is 'missing'
translunar commentedon Sep 24, 2013
Since there's been no reply from the author in three months, I'll go ahead and recommend you try out rubyvis or plotrb. Plotrb may be more appropriate for a Rails app.
rdp commentedon Sep 24, 2013
what is causing it to be undefined? does ::GnuPlot work?
ashrocket commentedon Sep 25, 2013
As the OP said, it's somehow related to the GSL Gem.
So, this is probably not the correct forum.
Somehow the Namespace gets hidden so you can't refere to Gnuplot or GSL::Gnuplot because the RB GSL gem requires that Gnuplot be loaded first, which it is in my Gemfile, and the latest Bundler is supposed to respect that.
ashrocket commentedon Sep 25, 2013
I need something like Gnuplot though, the other libs are fine for the Web App, but I'm running code in the Rails Environment, but not necessarily in a Rails App, so I need to be able to "see" my work from the Shell, which worked great when I was only in Ruby. But to access my Models, I needed to run my script as Rails run lib/script.rb
And now the Plot functions don't work, but as I said, it's a GSL problem.
nurettin commentedon Jul 23, 2014
related: http://stackoverflow.com/a/24902719/227755