QNAP TS-239にRailsをインストールしてみる(1)
TS-239を放置しておくのもなんなので、試しにRailsをインストールしてみる。
Optware IPKGをインストール
- 管理ページにログイン
- [Applications] - [QPKG Plugins]を選択し、GET QPKGボタンを押下
- Optware IPKG (Itsy Package Management System)をダウンロードする。
- 解凍してInstallationタブの[ファイルを選択]ボタンでアップロードする。
- [INSTALLボタンを押下]
ruby 1.8.7 インストール
- wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p302.tar.gz
- tar zxvf ruby-1.8.7-p302.tar.gz
- cd ruby-1.8.7-p302
- ipkg install gcc
ここまで実行して ./configure を実行したところ、"checking for grep that handles long lines and -e... configure: error: no acceptable grep could be found" というエラーが発生。
ここまで実行して ./configure を実行したところ、今度は以下のエラーが発生。
"awk: ./confOiyPJQ/subs.awk:2: Unexpected token"
"config.status: error: could not create Makefile"
- ipkg install gawk
- rm /bin/awk
- ipkg install sed
- rm /bin/sed
- ./configure --prefix=/opt
- ipkg install make
- make
- make install
動作確認
[/share/Public/rubygems-1.3.7] # which ruby /opt/bin/ruby [/share/Public/rubygems-1.3.7] # ruby -v ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux] [/share/Public/rubygems-1.3.7] #
rubygems 1.3.7 インストール
- wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
- tar zxvf rubygems-1.3.7.tgz
- cd rubygems-1.3.7.tgz
- ruby setup.rb
動作確認
[/share/Public/rubygems-1.3.7] # which gem /opt/bin/gem [/share/Public/rubygems-1.3.7] # gem -v 1.3.7 [/share/Public/rubygems-1.3.7] #
rails 2.3.5 インストール
[/share/Public/ruby-1.8.7-p302] # gem install rails --version "2.3.5" ERROR: Loading command: install (LoadError) no such file to load -- zlib ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand [/share/Public/ruby-1.8.7-p302] #
gem使うとno such file to load -- zlibというエラーがでる - 橋本詳解を参考に、以下のように対処。
[/share/Public/ruby-1.8.7-p302/ext/zlib] # gem install rails --version "2.3.5" Successfully installed rake-0.8.7 Successfully installed activesupport-2.3.5 Successfully installed activerecord-2.3.5 Successfully installed rack-1.0.1 Successfully installed actionpack-2.3.5 Successfully installed actionmailer-2.3.5 Successfully installed activeresource-2.3.5 Successfully installed rails-2.3.5 8 gems installed Installing ri documentation for rake-0.8.7... Installing ri documentation for activesupport-2.3.5... Installing ri documentation for activerecord-2.3.5... Installing ri documentation for rack-1.0.1... Installing ri documentation for actionpack-2.3.5... Installing ri documentation for actionmailer-2.3.5... Installing ri documentation for activeresource-2.3.5... Installing ri documentation for rails-2.3.5... Installing RDoc documentation for rake-0.8.7... Installing RDoc documentation for activesupport-2.3.5... Installing RDoc documentation for activerecord-2.3.5... Installing RDoc documentation for rack-1.0.1... Installing RDoc documentation for actionpack-2.3.5... Installing RDoc documentation for actionmailer-2.3.5... Installing RDoc documentation for activeresource-2.3.5... Installing RDoc documentation for rails-2.3.5... [/share/Public/ruby-1.8.7-p302/ext/zlib] # rails --version Rails 2.3.5 [/share/Public/ruby-1.8.7-p302/ext/zlib] #