From: Chris Hulan Date: 2013-01-26T00:41:32+09:00 Subject: Re: Gem loads in irb but not console --14dae9cfc8a8cf73ae04d41eacc0 Content-Type: text/plain; charset=ISO-8859-1 running 2 separate ruby commands creates 2 separate processes either put the code into a file and run the file or put both requires in a single -e parameter On Fri, Jan 25, 2013 at 10:14 AM, Martin Kociman wrote: > Hi! > > I have the next problem: I was install a gem. The gem work well in > 'irb', but doesn't work in console. What is the problem? Please, help! > > Now, I print my 'step by step': > a. > root@iway-cacique:~# gem install selenium-webdriver > Successfully installed multi_json-1.5.0 > Successfully installed rubyzip-0.9.9 > Successfully installed ffi-1.3.1 > Successfully installed childprocess-0.3.7 > Successfully installed websocket-1.0.6 > Successfully installed selenium-webdriver-2.29.0 > 6 gems installed > > b. > root@iway-cacique:~# irb > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> require 'selenium-webdriver' > => true > > c. > root@iway-cacique:~# ruby -e 'require "rubygems"' > root@iway-cacique:~# ruby -e 'require "selenium-webdriver"' > -e:1:in `require': no such file to load -- selenium-webdriver > (LoadError) > from -e:1 > > ######################## > #Additional Information# > ######################## > > root@iway-cacique:~# irb > irb(main):001:0> require 'rubygems' > => true > irb(main):002:0> Gem.path > => ["/usr/lib/ruby/gems/1.8", "/root/.gem/ruby/1.8"] > ------------------------ > > root@iway-cacique:~# gem which 'selenium-webdriver' > > /usr/lib/ruby/gems/1.8/gems/selenium-webdriver-2.29.0/lib/selenium-webdriver.rb > ------------------------ > > root@iway-cacique:~# bundle show selenium-webdriver > /usr/lib/ruby/gems/1.8/gems/selenium-webdriver-2.29.0 > ------------------------ > > root@iway-cacique:~# ruby --version > ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] > ------------------------ > > root@iway-cacique:~# rails --version > Rails 2.3.9 > ------------------------ > > root@iway-cacique:~# gem env > RubyGems Environment: > - RUBYGEMS VERSION: 1.8.25 > - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i686-linux] > - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 > - RUBY EXECUTABLE: /usr/bin/ruby1.8 > - EXECUTABLE DIRECTORY: /usr/bin > - RUBYGEMS PLATFORMS: > - ruby > - x86-linux > - GEM PATHS: > - /usr/lib/ruby/gems/1.8 > - /root/.gem/ruby/1.8 > - GEM CONFIGURATION: > - :update_sources => true > - :verbose => true > - :benchmark => false > - :backtrace => false > - :bulk_threshold => 1000 > - REMOTE SOURCES: > - http://rubygems.org/ > > -- > Posted via http://www.ruby-forum.com/. > > --14dae9cfc8a8cf73ae04d41eacc0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
running 2 separate ruby commands creates 2 separate proces= ses

either put the code into a file and run = the file

or put both=A0requires=A0in a= single -e parameter


On Fri,= Jan 25, 2013 at 10:14 AM, Martin Kociman <lists@ruby-forum.com>= wrote:
Hi!

I have the next problem: I was install a gem. The gem work well in
'irb', but doesn't work in console. What is the problem? Please= , help!

Now, I print my 'step by step':
a.
root@iway-cacique:~# gem install selenium-webdriver
Successfully installed multi_json-1.5.0
Successfully installed rubyzip-0.9.9
Successfully installed ffi-1.3.1
Successfully installed childprocess-0.3.7
Successfully installed websocket-1.0.6
Successfully installed selenium-webdriver-2.29.0
6 gems installed

b.
root@iway-cacique:~# irb
irb(main):001:0> require 'rubygems'
=3D> true
irb(main):002:0> require 'selenium-webdriver'
=3D> true

c.
root@iway-cacique:~# ruby -e 'require "rubygems"'
root@iway-cacique:~# ruby -e 'require "selenium-webdriver"= 9;
-e:1:in `require': no such file to load -- selenium-webdriver
(LoadError)
=A0 =A0 =A0 =A0 from -e:1

########################
#Additional Information#
########################

root@iway-cacique:~# irb
irb(main):001:0> require 'rubygems'
=3D> true
irb(main):002:0> Gem.path
=3D> ["/usr/lib/ruby/gems/1.8", "/root/.gem/ruby/1.8"= ;]
------------------------

root@iway-cacique:~# gem which 'selenium-webdriver'
/usr/lib/ruby/gems/1.8/gems/selenium-webdriver-2.29.0/lib/selenium-webdrive= r.rb
------------------------

root@iway-cacique:~# bundle show selenium-webdriver
/usr/lib/ruby/gems/1.8/gems/selenium-webdriver-2.29.0
------------------------

root@iway-cacique:~# ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
------------------------

root@iway-cacique:~# rails --version
Rails 2.3.9
------------------------

root@iway-cacique:~# gem env
RubyGems Environment:
=A0 - RUBYGEMS VERSION: 1.8.25
=A0 - RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
=A0 - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
=A0 - RUBY EXECUTABLE: /usr/bin/ruby1.8
=A0 - EXECUTABLE DIRECTORY: /usr/bin
=A0 - RUBYGEMS PLATFORMS:
=A0 =A0 - ruby
=A0 =A0 - x86-linux
=A0 - GEM PATHS:
=A0 =A0 =A0- /usr/lib/ruby/gems/1.8
=A0 =A0 =A0- /root/.gem/ruby/1.8
=A0 - GEM CONFIGURATION:
=A0 =A0 =A0- :update_sources =3D> true
=A0 =A0 =A0- :verbose =3D> true
=A0 =A0 =A0- :benchmark =3D> false
=A0 =A0 =A0- :backtrace =3D> false
=A0 =A0 =A0- :bulk_threshold =3D> 1000
=A0 - REMOTE SOURCES:
=A0 =A0 =A0- http://ruby= gems.org/

--
Posted via http://= www.ruby-forum.com/.


--14dae9cfc8a8cf73ae04d41eacc0--