お名前.comのVPSでRails3を動かす - (2) railsをインストール
Rails3をインストール
$ su # gem install rails
Rails3がインストールされたがワーニングがる。
取りあえず、後で対応することにする。
gem install railsでのワーニング
It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.
Railsのバージョンを確認すると3.1.1に変わっている<<<
[root@atotok work]# rails -v
Rails 3.1.1
rails new test1を実行するとプロジェクトは作成されるがエラーになってしまう。
/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `<top (required)>': It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.yamlをインストール
yamlをhttp://pyyaml.org/wiki/LibYAMLからダウンロード
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz $ tar xvfz yaml-0.1.4.tar.gzyamlをインストール
$ cd yaml-0.1.4 $ ./configure $ make $ su # make installrubyを再インストール
# cd ruby-1.9.3-p0 # make clean # ./configure # make # make installこれでrails newしてもYAMLのエラーは出なくなっったが、別のエラーが
statement.c:52: 警告: implicit declaration of function ‘sqlite3_prepare_v2’ statement.c: In function ‘bind_param’: statement.c:268: error: ‘sqlite3_int64’ undeclared (first use in this function) statement.c:268: error: (Each undeclared identifier is reported only once statement.c:268: error: for each function it appears in.) statement.c:268: error: expected expression before ‘long’ make: *** [statement.o] エラー 1 Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.4 for inspection. Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out An error occured while installing sqlite3 (1.3.4), and Bundler cannot continue. Make sure that `gem install sqlite3 -v '1.3.4'` succeeds before bundling.