ruote-on-rails and Gemfile / Gem issues

37 views
Skip to first unread message

Christophe Malaurie

unread,
Feb 8, 2012, 12:43:32 PM2/8/12
to ruote
Hi all
I installed and ran successfully this ruote-on-rails e.g. I ran
processes thru the Rails interface.
Now I'm trying to run some ruote tests from / within the same
environment. I took the "first run" example found in your pages, put
it in a ruby script (let's call it oneproc.rb) and tried from the
"rails application" directory to run the test in the 2 following ways:

> ./oneproc.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file
to load -- ruote (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from ./oneproc.rb:3:in `<main>'

> bundle exec ./oneproc.rb
http://github.com/jmettraux/ruote.git (at master) is not checked out.
Please run `bundle install`

Believe me I tried to run bundle install several times, no effect, and
when I list the Gems installed ruote is clearly detected as installed.
..
ruote (2.2.0, 2.1.9)
ruote-dm (2.1.9)
ruote-kit (2.1.8.2)
..

If anyone has got an idea, I would appreciate.
Many thanks in advance
Christophe

John Mettraux

unread,
Feb 8, 2012, 12:50:11 PM2/8/12
to openwfe...@googlegroups.com

On Wed, Feb 08, 2012 at 09:43:32AM -0800, Christophe Malaurie wrote:
>
> > ./oneproc.rb
> <internal:lib/rubygems/custom_require>:29:in `require': no such file
> to load -- ruote (LoadError)
> from <internal:lib/rubygems/custom_require>:29:in `require'
> from ./oneproc.rb:3:in `<main>'
>
> > bundle exec ./oneproc.rb
> http://github.com/jmettraux/ruote.git (at master) is not checked out.
> Please run `bundle install`

Hello Christophe,

are you requiring rubygems and bundler/setup in your oneproc.rb ?

---8<---
require 'rubygems'
require 'bundler/setup'
require 'ruote'

# ...
--->8---

http://gembundler.com/


Best regards,

--
John Mettraux - http://lambda.io/processi

Christophe Malaurie

unread,
Feb 8, 2012, 12:58:31 PM2/8/12
to ruote
Hi John
yes I am requiring 'rubygems' which normally is not necessary anymore
since ruby 1.9.2 if I'm not wrong.
I added then require 'bundler/setup' and have the same result.
http://github.com/jmettraux/ruote.git (at master) is not checked out.
Please run `bundle install`

Hum, I made some another tests :
> rails c < oneproc.rb
as well as
> irb < oneproc.rb
Both run fine (it runs the example) with no problem.
tx

On Feb 8, 6:50 pm, John Mettraux <jmettr...@gmail.com> wrote:
> On Wed, Feb 08, 2012 at 09:43:32AM -0800, Christophe Malaurie wrote:
>
> > > ./oneproc.rb
> > <internal:lib/rubygems/custom_require>:29:in `require': no such file
> > to load -- ruote (LoadError)
> >         from <internal:lib/rubygems/custom_require>:29:in `require'
> >         from ./oneproc.rb:3:in `<main>'
>
> > > bundle exec ./oneproc.rb
> >http://github.com/jmettraux/ruote.git(at master) is not checked out.

John Mettraux

unread,
Feb 8, 2012, 1:28:53 PM2/8/12
to openwfe...@googlegroups.com

On Wed, Feb 08, 2012 at 09:58:31AM -0800, Christophe Malaurie wrote:
>
> yes I am requiring 'rubygems' which normally is not necessary anymore
> since ruby 1.9.2 if I'm not wrong.
> I added then require 'bundler/setup' and have the same result.
> http://github.com/jmettraux/ruote.git (at master) is not checked out.
> Please run `bundle install`
>
> Hum, I made some another tests :
> > rails c < oneproc.rb
> as well as
> > irb < oneproc.rb
> Both run fine (it runs the example) with no problem.

Hello,

if you're still stuck, maybe you could show your Gemfile, Gemfile.lock and
oneproc.rb


Cheers,

John Mettraux

unread,
Feb 8, 2012, 2:18:40 PM2/8/12
to ruote
Hello Christophe,

have you tried replacing

#!/usr/bin/ruby

by

#!/usr/bin/env ruby

in your oneproc.rb, so that your current ruby is used, not your system ruby.

If oneproc.rb comes from ruote, please tell me where I can fix that.

Thanks in advance,

Christophe Malaurie

unread,
Feb 8, 2012, 2:58:41 PM2/8/12
to openwfe...@googlegroups.com
Yep John I tried as well and it does not make any difference.
So it looks that running (rails, rails -c or irb) are loading the right environment, when running it from the terminal is not okay with the bundler environment.
My ruby installation has been cleaned up and rebuilt from scratch and is running fine, at least no other problem to report.

I tried as well to set RUBYOPTS:

> echo $RUBYOPT
-rbundler/setup
> bundle exec ./oneproc.rb
/usr/bin/ruby1.8: no such file to load -- bundler/setup (LoadError)
> ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
> which ruby
/usr/bin/ruby

So oneproc.rb is a copy of your ruby examples/ruote_quickstart.rb and I do not believe this is a problem with your example, this is a problem with the ruby environment that I cannot see so far: in a way it looks that something is missing somewhere.

I used to install ruote many times and had some other problems but all with quick fixes ran perfectly.
This time I do not see where to look at. I cleaned the Gems, the Bundle files and so on. i have only one ruby version installed.

tx
cheers

--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to openwfe...@googlegroups.com
to unsubscribe : send email to openwferu-use...@googlegroups.com
more options : http://groups.google.com/group/openwferu-users?hl=en

John Mettraux

unread,
Feb 8, 2012, 3:03:55 PM2/8/12
to openwfe...@googlegroups.com

On Wed, Feb 08, 2012 at 08:58:41PM +0100, Christophe Malaurie wrote:
>
> So oneproc.rb is a copy of your ruby examples/ruote_quickstart.rb and I do
> not believe this is a problem with your example, this is a problem with the
> ruby environment that I cannot see so far: in a way it looks that something
> is missing somewhere.

OK, ruote_quickstart.rb doesn't have a hashbang line. Nothing to fix for me,
great.

> I used to install ruote many times and had some other problems but all with
> quick fixes ran perfectly.
> This time I do not see where to look at. I cleaned the Gems, the Bundle
> files and so on. i have only one ruby version installed.

what do

---8<---
which bundle
cat `which bundle`
--->8---

yield?

It might be interesting to see what's the first line of the bundle script.


Cheers,

Christophe Malaurie

unread,
Feb 8, 2012, 3:09:11 PM2/8/12
to openwfe...@googlegroups.com
Yep I had a look to the file as well and saw that
> which bundle
/usr/local/bin/bundle
> cat `which bundle`
#!/usr/bin/ruby1.8
#
# This file was generated by RubyGems.
#
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
  version = $1
  ARGV.shift
end

gem 'bundler', version
load Gem.bin_path('bundler', 'bundle', version)

and I saw the reference to ruby 1.8 . Note that when I saw that I ran 'gem update bundle' and this file has not been changed.
...
cheers

John Mettraux

unread,
Feb 8, 2012, 3:14:54 PM2/8/12
to openwfe...@googlegroups.com
OK,

sorry, I'm out of ideas, I never had such an issue with Bundler.

John

Christophe Malaurie

unread,
Feb 8, 2012, 3:16:52 PM2/8/12
to openwfe...@googlegroups.com
yep thanks for your time, I never had it as well, I'll investigate more and let you know if I find the issue.
cheers


kedar mhaswade

unread,
Feb 8, 2012, 4:01:54 PM2/8/12
to openwfe...@googlegroups.com
On Wed, Feb 8, 2012 at 12:16 PM, Christophe Malaurie <christoph...@gmail.com> wrote:
yep thanks for your time, I never had it as well, I'll investigate more and let you know if I find the issue.
cheers


The way I ran the ruote quick-start example was by creating a separate clean gemset in rvm -- something like:
- rvm gemset create ruote_exp
- gem install ruote yajl-ruby
- gem install sinatra haml json ruote

Hope that helps.

Regards,
Kedar

Christophe Malaurie

unread,
Feb 9, 2012, 10:10:32 AM2/9/12
to ruote
Hi all
finally I have something running in a ruby 1.8.7p302 and Rails 3.0.10
environment.
Note: I advise you to be careful when installing ruby 1.9.2 on Debian
with rvm, there are missing libraries from the official rvm
installation (?? disappeared from ruby as I had to run > sudo apt-get -
y install zlib1g-dev libssl-dev libreadline5-dev libyaml-dev build-
essential bison checkinstall to have it working...)
Anyway the issue was related to the combination of using rubygems and
a Gemfile from ruote-on-rails example where the gem is not installed
locally as pointed to a git repository.

John, it looks nevertheless that there is a missing file in the master
branch on github namely <b>ruote/lib/ruote/log/test_logger.rb</b>
which prevents the examples/ruote_quickstart.rb to run successfully.

I'll now go back to my initial concern which was...using ruote.
Cheers and many tx to John and Kedar


On Feb 8, 10:01 pm, kedar mhaswade <kedar.mhasw...@gmail.com> wrote:
> On Wed, Feb 8, 2012 at 12:16 PM, Christophe Malaurie <
>

John Mettraux

unread,
Feb 9, 2012, 10:28:35 AM2/9/12
to openwfe...@googlegroups.com

On Thu, Feb 09, 2012 at 07:10:32AM -0800, Christophe Malaurie wrote:
>
> John, it looks nevertheless that there is a missing file in the master
> branch on github namely <b>ruote/lib/ruote/log/test_logger.rb</b>
> which prevents the examples/ruote_quickstart.rb to run successfully.

Ah yes,

https://github.com/jmettraux/ruote/commit/a35ac57183aa420c259dfe6dcfa77c8b0d8efa20


Many thanks,

Torsten Schönebaum

unread,
Feb 9, 2012, 4:40:48 PM2/9/12
to openwfe...@googlegroups.com
Christophe Malaurie wrote:

> finally I have something running in a ruby 1.8.7p302 and Rails 3.0.10
> environment.
> Note: I advise you to be careful when installing ruby 1.9.2 on Debian
> with rvm, there are missing libraries from the official rvm
> installation (?? disappeared from ruby as I had to run> sudo apt-get -
> y install zlib1g-dev libssl-dev libreadline5-dev libyaml-dev build-
> essential bison checkinstall to have it working...)

Let's see:
$ rvm notes

You _must_ read 'rvm requirements' for additional OS specific
requirements for various rubies, and native-extension gems. Expect
failures until those are met!

$ rvm requirements

Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the
following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6
libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev
libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
subversion
So your point is that one should read the documentation? At least `rvm
notes` is shown during rvm installation.

Sorry for being that harsh, but rvm's documentation is really good and
the installation notes are nearly too noisy...

> Anyway the issue was related to the combination of using rubygems and
> a Gemfile from ruote-on-rails example where the gem is not installed
> locally as pointed to a git repository.

Hmm, perhaps it's time to update ruote on rails. It's a shame I've been
absent from ruote that long, sorry.

Cheers,
Torsten

Torsten Schönebaum

unread,
Feb 9, 2012, 4:55:48 PM2/9/12
to openwfe...@googlegroups.com
Christophe Malaurie wrote:

> I installed and ran successfully this ruote-on-rails e.g. I ran
> processes thru the Rails interface.
> Now I'm trying to run some ruote tests from / within the same
> environment. I took the "first run" example found in your pages, put
> it in a ruby script (let's call it oneproc.rb) and tried from the
> "rails application" directory to run the test in the 2 following ways:

Despite the fact you have solved the problem for yourself, some hints
for fellows how get stuck at the same place: It's always better to
either use a clean slate for such trials or load the existing
environment properly. For the latter, you could have added
require 'config/application'
instead of the other requires, thous loading the same stuff
ruote-on-rails does.

HTH,
Torsten

Christophe Malaurie

unread,
Feb 10, 2012, 3:56:49 AM2/10/12
to openwfe...@googlegroups.com
tx Torsten
I fully agree with your comments, and next time I'll read very carefully the documentation.
Please note that solving the "rvm requirements" problem took me about an hour when I was indeed trying to solve a rubygem 'require' problem in a simple ruby script, which took me more than a day, just because rubygems is unable to find remote gems when Rails is (because of Bundler?) and certainly because I'm very very slow.
At least, removing the reference to git in the Gemfile solved all my issues.
All of it obvious to you? sorry for the inconvenience and ty for your work
cheers

2012/2/9 Torsten Schönebaum <torsten.s...@web.de>
--
you received this message because you are subscribed to the "ruote users" group.

Torsten Schönebaum

unread,
Feb 10, 2012, 4:20:09 AM2/10/12
to openwfe...@googlegroups.com
Christophe Malaurie wrote:

> Please note that solving the "rvm requirements" problem took me about an

> hour when I was indeed trying to solve a*rubygem 'require' problem* in a


> simple ruby script, which took me more than a day, just because rubygems
> is unable to find remote gems when Rails is (because of Bundler?)

Yes, because of Bundler. But you wrote that you required
"bundler/setup", so that you should have had the same environment
(regarding the gems) as in Rails.

> and certainly because I'm very very slow.
> At least, removing the reference to git in the Gemfile solved all my issues.
> All of it obvious to you?

No, unfortunately not. Your issue with Bundler not finding the "git
gems", although bundled, isn't far from obvious for me. I'd like to be
able to help you find the real cause of the problem. As far as I could
see, you were using a system wide ruby installation � perhaps bundler
had troubles with that. But that's a wild guess and I don't really
believe in it.

Thx for _your_ patience with me,
Torsten

Torsten Schönebaum

unread,
Feb 10, 2012, 4:53:32 AM2/10/12
to openwfe...@googlegroups.com
Meself wrote:
> Christophe Malaurie wrote:

>> and certainly because I'm very very slow.
>> At least, removing the reference to git in the Gemfile solved all my issues.
>> All of it obvious to you?
>
> No, unfortunately not. Your issue with Bundler not finding the "git
> gems", although bundled, isn't far from obvious for me.

Oi, sorry, s/isn't/is/

Cheers,
Torsten

Reply all
Reply to author
Forward
0 new messages