Hi,
I am new to ruby, just need one liner command in ruby to check any
installed version. like in perl we do
perl -MABC -e ‘print “$ABC::VERSION”’
Hi,
I am new to ruby, just need one liner command in ruby to check any
installed version. like in perl we do
perl -MABC -e ‘print “$ABC::VERSION”’
On Thu, Oct 4, 2012 at 11:49 AM, Abhishek K. [email protected]
wrote:
Hi,
I am new to ruby, just need one liner command in ruby to check any
installed version. like in perl we doperl -MABC -e ‘print “$ABC::VERSION”’
$ gem list nokogiri
*** LOCAL GEMS ***
nokogiri (1.5.5, 1.5.0)
Jesus.
“Jesús Gabriel y Galán” [email protected] wrote in post
#1078598:
On Thu, Oct 4, 2012 at 11:49 AM, Abhishek K. [email protected]
wrote:Hi,
I am new to ruby, just need one liner command in ruby to check any
installed version. like in perl we doperl -MABC -e ‘print “$ABC::VERSION”’
$ gem list nokogiri
*** LOCAL GEMS ***
nokogiri (1.5.5, 1.5.0)
Jesus.
Thanks Jesus, is there any way i can get by ruby command like
ruby1.8 -rMODULE -e ‘puts …’
ruby1.9.1 -rMODULE -e ‘puts …’
On 10/04/2012 12:03 PM, Abhishek K. wrote:
nokogiri (1.5.5, 1.5.0)
Thanks Jesus, is there any way i can get by ruby command like
ruby1.8 -rMODULE -e ‘puts …’
ruby1.9.1 -rMODULE -e ‘puts …’
If you want to search for more information on this topic, note that the
correct term for “modules” in the Ruby world is “gems”.
You can get at information about installed gems from Ruby code through
the Gem::Specification class.
http://rubygems.rubyforge.org/rubygems-update/Gem/Specification.html
What are you going to do with that information, though? If your code
depends on certain versions of gems, you should take a look at Bundler.
Lars H. wrote in post #1078607:
On 10/04/2012 12:03 PM, Abhishek K. wrote:
nokogiri (1.5.5, 1.5.0)
Thanks Jesus, is there any way i can get by ruby command like
ruby1.8 -rMODULE -e ‘puts …’
ruby1.9.1 -rMODULE -e ‘puts …’If you want to search for more information on this topic, note that the
correct term for “modules” in the Ruby world is “gems”.You can get at information about installed gems from Ruby code through
the Gem::Specification class.http://rubygems.rubyforge.org/rubygems-update/Gem/Specification.html
What are you going to do with that information, though? If your code
depends on certain versions of gems, you should take a look at Bundler.http://gembundler.com/
thanks for your responce
I need to check what all gems(modules) installed and what is therir
version on each version of ruby, we have two version installed ruby1.8
and ruby1.92
i am looking something we do in perl and python same way in ruby like
perl -MABC -e ‘print “$ABC::VERSION”’
python -c “import MODULE; print (MODULE.version)”;
On 10/04/2012 12:32 PM, Abhishek K. wrote:
i am looking something we do in perl and python same way in ruby like
perl -MABC -e ‘print “$ABC::VERSION”’
python -c “import MODULE; print (MODULE.version)”;
List all gems and their version:
$ ruby -e ‘puts Gem::Specification.map {|gem| “#{gem.name}:
#{gem.version}”}’
List all installed versions of a particular gem:
$ ruby -e ‘puts
Gem::Specification.find_all_by_name(“rake”).map(&:version)’
Lars H. wrote in post #1078619:
On 10/04/2012 12:32 PM, Abhishek K. wrote:
i am looking something we do in perl and python same way in ruby like
perl -MABC -e ‘print “$ABC::VERSION”’
python -c “import MODULE; print (MODULE.version)”;
List all gems and their version:
$ ruby -e ‘puts Gem::Specification.map {|gem| “#{gem.name}:
#{gem.version}”}’List all installed versions of a particular gem:
$ ruby -e ‘puts
Gem::Specification.find_all_by_name(“rake”).map(&:version)’
Thanks Lars.
This is not giving all but only inside Gems dir
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs