Translation(s): English - Italiano - Japanese
Ruby in Debian
Edit conflict - other version:
このページでは Debian における Ruby のインストールと使い方について記述しています。Debian の Ruby パッケージに関する情報については Teams/Ruby をご覧下さい。
Edit conflict - your version:
このページでは Debian における Ruby のインストールと使い方について記述しています。Debian の Ruby パッケージに関する情報については Teams/Ruby をご覧下さい。
End of edit conflict
このページは短縮 URL: http://deb.li/ruby でもご利用頂けます(現在英語版へのリンクになっています)。
Contents
-
Ruby in Debian
- Debian 8 (Jessie) で利用可能なインタープリタ
- Debian 7 (wheezy) で利用可能なインタープリタ
- Debian 8 (Jessie) で利用可能なインタープリタ
- Debian 7 (wheezy) で利用可能なインタープリタ
- (wheezy のみ) システム全体でデフォルトの Ruby インタープリタを選択するには
- (wheezy のみ) システム全体でデフォルトの Ruby インタープリタを選択するには
- ユーザ毎にデフォルトの Ruby インタープリタを選択するには
- Debian パッケージになっていない Ruby をインストールするには
- Ruby 関連のその他の wiki ページ
Edit conflict - other version:
Debian 8 (Jessie) で利用可能なインタープリタ
残念ながら Rubinius は jessie には含まれていません.
MRI の alternatives による切り替え,すなわち update-alternatives サポートは削除されました. alternatives の削除に関する長い説明については https://lists.debian.org/debian-ruby/2014/03/msg00077.html および https://lists.debian.org/debian-project/2014/02/msg00028.html を参照下さい.
Debian 7 (wheezy) で利用可能なインタープリタ
Debian Wheezy では以下の Ruby インタープリタが利用できます:
Edit conflict - your version:
Debian 8 (Jessie) で利用可能なインタープリタ
残念ながら Rubinius は jessie には含まれていません.
MRI の alternatives による切り替え,すなわち update-alternatives サポートは削除されました. alternatives の削除に関する長い説明については https://lists.debian.org/debian-ruby/2014/03/msg00077.html および https://lists.debian.org/debian-project/2014/02/msg00028.html を参照下さい.
Debian 7 (wheezy) で利用可能なインタープリタ
Debian Wheezy では以下の Ruby インタープリタが利用できます:
End of edit conflict
インタープリタ |
パッケージ |
注意書き |
MRI 1.8.7 |
|
|
MRI 1.9.3 |
|
|
JRuby |
|
|
Rubinius |
rubinius |
Work in progress, not actually available yet |
update-alternatives を使う事で、デフォルトの "ruby" として異なる Ruby インタープリタを切り換えることが可能です。 しかしながら、"ruby" を切り換える際には恐らく "gem" や "irb" などのデフォルトも切り替えたいでしょう。 そのため、これらを一度に変更するためのショートカットが存在します。
Edit conflict - other version:
(wheezy のみ) システム全体でデフォルトの Ruby インタープリタを選択するには
Edit conflict - your version:
(wheezy のみ) システム全体でデフォルトの Ruby インタープリタを選択するには
End of edit conflict
システム全体でデフォルトの Ruby インタープリタを選択するために、ruby-switch パッケージが使用可能です。 これは root として(もしくは sudo を使って)実行する必要があります。
# ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] # ruby-switch --list ruby1.8 ruby1.9.1 # ruby-switch --set ruby1.9.1 update-alternatives: using /usr/bin/gem1.9.1 to provide /usr/bin/gem (gem) in manual mode. update-alternatives: using /usr/bin/ruby1.9.1 to provide /usr/bin/ruby (ruby) in manual mode. # ruby -v ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] # ruby-switch --auto update-alternatives: using /usr/bin/ruby1.8 to provide /usr/bin/ruby (ruby) in auto mode. update-alternatives: using /usr/bin/gem1.8 to provide /usr/bin/gem (gem) in auto mode. # ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
ユーザ毎にデフォルトの Ruby インタープリタを選択するには
ユーザアカウント毎にデフォルトの Ruby インタープリタを切り替えるには、rbenv パッケージを使用するべきです。
$ ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] ---- /!\ '''Edit conflict - other version:''' ---- $ rbenv init ---- /!\ '''Edit conflict - your version:''' ---- $ rbenv init ---- /!\ '''End of edit conflict''' ---- # Load rbenv automatically by adding # the following to ~/.bash_profile: eval "$(rbenv init -)" $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile # or ~/.bashrc, depends on your setup $ rbenv versions ---- /!\ '''Edit conflict - other version:''' ---- $ rbenv alternatives ---- /!\ '''Edit conflict - your version:''' ---- $ rbenv alternatives ---- /!\ '''End of edit conflict''' ---- $ rbenv versions 1.8.7-debian 1.9.3-debian ---- /!\ '''Edit conflict - other version:''' ---- $ rbenv global 1.9.3-debian ---- /!\ '''Edit conflict - your version:''' ---- $ rbenv global 1.9.3-debian ---- /!\ '''End of edit conflict''' ---- $ ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
一見ちゃんと動作していないように見えますが、これは現在実行中のシェルが "ruby" の位置として /usr/bin/ruby をキャッシュしているからです。新しいシェルを開始した後には、デフォルトの Ruby を行ったり来たり切り替えることができます。
$ ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] ---- /!\ '''Edit conflict - other version:''' ---- $ rbenv global 1.9.3-debian $ ruby -v ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] $ rbenv global 1.8.7-debian ---- /!\ '''Edit conflict - your version:''' ---- $ rbenv global 1.9.3-debian $ ruby -v ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] $ rbenv global 1.8.7-debian ---- /!\ '''End of edit conflict''' ---- $ ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Debian パッケージになっていない Ruby をインストールするには
ruby-build を使用することで、Debian でまだ使用可能になっていない Ruby インタープリタをインストールすることができます。しかしながら、このパッケージの README.Debian ファイルに書かれている内容に注意して下さい:
- While ruby-build is a great tool to build Ruby versions that are not available via APT, you should still use the Debian-packaged versions of Ruby whenever possible since they are tested and supported by the Debian community.
Please do not report bugs you encounter while using your homebuilt Rubies to the Debian team; Rubies built by yourself are not supported.
(日本語訳)
- ruby-build は APT を使って取得することができない Ruby のバージョンを ビルド可能な素晴しいツールです。しかしながら、可能な限り Debian でパ ッケージングされている Ruby を使い続けるべきです。なぜならば、これら は Debian コミュニティによってテストされ、サポートされているからです。
自家製の Ruby を用いることで遭遇したバグを Debian チームに報告しな いで下さい。あなた自身の手でビルドされた Ruby はサポート対象外です。
Ruby 関連のその他の wiki ページ
- BalasankarC/DebianRuby
- BalasankarC/DebianRuby/Packaging
- BalasankarC/DebianRuby/Packaging/Conventions
- BalasankarC/DebianRuby/Packaging/TestFailures
- BalasankarC/DebianRuby/Packaging/Tests
- JongminKim/Drafts/RubyPackaging
- Packaging/ruby-team-meta-build
- ReproducibleBuilds/TimestampsInRubyDocumentation
- Ruby
- Ruby/Packaging/Tests
- Ruby/Packaging/newUpstreamRailsApp
- SummerOfCode2020/ApprovedProjects/UpstreamDownstreamCooperationInRuby
- SummerOfCode2020/UnApprovedProjects/UpstreamDownstreamCooperationInRuby
- Teams/DebianRubyExtras
- Teams/Ruby
- Teams/Ruby/CrossBuilding
- Teams/Ruby/Drafts/StateOfTransitionNewPolicy
- Teams/Ruby/Drafts/StateOfTransitionNewPolicyReleaseTeam
- Teams/Ruby/Drafts/SwitchToOneNine
- Teams/Ruby/IRCMeetings
- Teams/Ruby/InterpreterTransitions
- Teams/Ruby/Jessie
- Teams/Ruby/Meeting/Brazil2016
- Teams/Ruby/Meeting/Kochi2024
- Teams/Ruby/Meeting/Paris2014
- Teams/Ruby/Meeting/Paris2015
- Teams/Ruby/Meeting/Paris2015/Report
- Teams/Ruby/Meeting/Paris2020
- Teams/Ruby/Meeting/Paris2023
- Teams/Ruby/Packaging
- Teams/Ruby/Packaging/Archive
- Teams/Ruby/Packaging/Conventions
- Teams/Ruby/Packaging/ITP
- Teams/Ruby/Packaging/Obsolete
- Teams/Ruby/Packaging/RailsApps
- Teams/Ruby/Packaging/RailsEngines
- Teams/Ruby/Packaging/Tests
- Teams/Ruby/Packaging/TransitionsPrimer
- Teams/Ruby/Packaging/gem2deb
- Teams/Ruby/Packaging/newUpstreamRailsApp
- Teams/Ruby/Packaging/origsource
- Teams/Ruby/RSpec3
- Teams/Ruby/Rails3
- Teams/Ruby/Rails3 (foo.tar.gz)
- Teams/Ruby/Rails3 (testapp.tar.gz)
- Teams/Ruby/Rails4.2
- Teams/Ruby/Rails6
- Teams/Ruby/Rails6/DependenciesTransition
- Teams/Ruby/Rails6/RailsBreakingChanges
- Teams/Ruby/Rails6/ReverseDependenciesTransition
- Teams/Ruby/Ruby2.2
- Teams/Ruby/RubyExtras
- Teams/Ruby/RubyExtras/OnRubygems
- Teams/Ruby/RubyExtras/Ruby19Porting
- Teams/Ruby/RubyExtras/RubyPackageTools
- Teams/Ruby/RubyExtras/UpstreamDevelopers
- Teams/Ruby/RubyInWheezy
- Teams/Ruby/Salsa
- Teams/Ruby/UpstreamPledge
- Teams/Ruby/Workflow
- Teams/Ruby/ruby2.5
- it/Ruby
- ja/Ruby