在ubuntu下安裝ruby需要注意的事情

2021-08-29 08:31:20 字數 3478 閱讀 5823

這裡說的是通過apt-get安裝ruby,自己編譯的情況就免了。

首先,在安裝ruby本身時一定要把ruby和ruby-dev全安裝了。現在的版本是1.8,因此應該執行如下命令

[code]

sudo apt-get install ruby1.8 ruby1.8-dev rubygems

[/code]

這是因為許多plugin或者gems都要依賴dev下面的東東,比如ferret就要用到乙個叫mkmf的東西,後者就是包含在dev中的。

然後可以gem或者apt-get來安裝rails,不過推薦前者,因為版本肯定是最新的。比如我用的源裡面的rails還不是1.2的呢,用apt-get就不好了。

最後就是找找這些東東都安裝在哪兒了,可以在根目錄下執行find命令

[code]

sudo find -iname *ruby* >> result.txt

[/code]

下面是我電腦上的執行結果

[code]

./usr/share/doc/ruby

./usr/share/doc/ruby/ruby-policy.sgml.gz

./usr/share/doc/ruby/ruby-policy.txt.gz

./usr/share/doc/ruby/ruby-policy.html

./usr/share/doc/ruby/ruby-policy.html/ch-ruby.html

./usr/share/doc/ruby/ruby-policy.html/ap-ruby1.8_bundled_modules.html

./usr/share/doc/rubygems

./usr/share/doc/libreadline-ruby1.8

./usr/share/doc/ruby1.8-dev

./usr/share/doc/libruby1.8

./usr/share/doc/ruby1.8

./usr/share/doc/libopenssl-ruby1.8

./usr/share/doc/libgems-ruby1.8

./usr/share/doc/libgems-ruby1.8/test/data/legacy/keyedlist-0.4.0.ruby

./usr/share/gedit-2/plugins/snippets/ruby.xml

./usr/share/gtksourceview-1.0/language-specs/ruby.lang

./usr/share/man/man1/ruby1.8.1.gz

./usr/share/man/man1/ruby.1.gz

./usr/share/nano/ruby.nanorc

./usr/bin/update_rubygems

./usr/bin/ruby

./usr/bin/ruby1.8

./usr/lib/libruby1.8-static.a

./usr/lib/ruby

./usr/lib/ruby/gems/1.8/doc/rubygems-0.9.4

./usr/lib/ruby/gems/1.8/doc/rubygems-0.9.4/ri/gem/specification/to_ruby-i.yaml

./usr/lib/ruby/gems/1.8/doc/rubygems-0.9.4/ri/gem/commands/updatecommand/do_rubygems_update-i.yaml

./usr/lib/ruby/gems/1.8/doc/rubygems-0.9.4/ri/gem/ruby-c.yaml

./usr/lib/ruby/gems/1.8/doc/rubygems-0.9.4/rdoc/files/lib/rubygems_rb.html

./usr/lib/ruby/gems/1.8/doc/rubygems-0.9.4/rdoc/files/lib/rubygems

./usr/lib/ruby/gems/1.8/doc/rubygems-0.9.4/rdoc/files/lib/rubygems/rubygems_version_rb.html

./usr/lib/ruby/gems/1.8/doc/actionwebservice-1.2.3/ri/actionwebservice/protocol/soap/soapmarshaler/ruby_to_soap-i.yaml

./usr/lib/ruby/gems/1.8/doc/actionwebservice-1.2.3/ri/actionwebservice/protocol/soap/soapmarshaler/soap_to_ruby-i.yaml

./usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/ruby182_test_unit_fix.rb

./usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/contrib/rubyforgepublisher.rb

./usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/ruby_version_check.rb

./usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/rubyprof_ext.rb

./usr/lib/ruby/1.8/rubygems

./usr/lib/ruby/1.8/rubygems/rubygems_version.rb

./usr/lib/ruby/1.8/rubygems.rb

./usr/lib/ruby/1.8/yaml/rubytypes.rb

./usr/lib/ruby/1.8/wsdl/xmlschema/xsd2ruby.rb

./usr/lib/ruby/1.8/wsdl/soap/wsdl2ruby.rb

./usr/lib/ruby/1.8/irb/ruby-token.rb

./usr/lib/ruby/1.8/irb/ruby-lex.rb

./usr/lib/ruby/1.8/i486-linux/rubyio.h

./usr/lib/ruby/1.8/i486-linux/rubysig.h

./usr/lib/ruby/1.8/i486-linux/ruby.h

./usr/lib/ruby/1.8/rubyunit.rb

./usr/lib/libruby1.8.so.1.8.5

./usr/lib/libruby1.8.so

./usr/lib/libruby1.8.so.1.8

./usr/local/lib/site_ruby

./usr/local/lib/site_ruby/1.8/rubygems

./usr/local/lib/site_ruby/1.8/rubygems/rubygems_version.rb

./usr/local/lib/site_ruby/1.8/rubygems.rb

[/code]

在ubuntu下編譯ruby

編譯環境不多說了,其實ruby不怎麼要求,基本上 quote sudo apt get install build essential quote 就差不多了。要注意一般是需要ssl和readline的類庫。quote sudo apt get install libreadline5 dev li...

在Ubuntu上安裝Ruby

這些受經濟危機的影響,各個公司風雲變換,就連我待部門也不例外,心頭總是感到很沉重的危機感。偶然瞥見書架上一年前買的 programming ruby 終於決定再次把它拿出來,繼續學習,也好為以後的 不測 做個準備。前幾天看到同事用ubuntu,感覺挺有意思,於是就準備也學習一下,就確定了在ubunt...

ubuntu 下ruby 的安裝

準備 sudo apt get install build essential sudo apt get install gcc sudo apt get install g sudo apt get install libssl0.9.8 sudo apt get install libssl0....