2014年5月12日月曜日

Macにbundlerでrailsを入れてみた

Macにbundlerでrails4.1.0を入れてみました。
Gemfileにrailsを追加。
$ vim Gemfile
$ cat Gemfile
source 'https://rubygems.org'
gem 'chef','~> 11.10.0'
gem 'berkshelf'
gem 'knife-solo'
gem 'rails'

bundleを実行。
$ bundle --path vendor/bundle
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies....
Installing rake 10.3.1
Installing actionpack 1.4.0
Installing actionmailer 0.6.1
Installing activerecord 1.6.0
Using i18n 0.6.9
Using multi_json 1.9.2
Using activesupport 3.2.17
Using addressable 2.3.6
Using builder 3.2.2
Using gyoku 1.1.1
Using mini_portile 0.5.3
Using nokogiri 1.6.1
Using akami 1.2.1
Using buff-ruby_engine 0.1.0
Using buff-shell_out 0.1.1
Using hashie 2.1.1
Using chozo 0.6.1
Using multipart-post 1.2.0
Using faraday 0.8.9
Using minitar 0.5.4
Using rbzip2 0.2.0
Using retryable 1.3.5
Using buff-extensions 0.5.0
Using varia_model 0.3.2
Using buff-config 0.4.0
Using buff-ignore 1.1.1
Using hitimes 1.2.1
Using timers 2.0.0
Using celluloid 0.14.1
Using nio4r 1.0.0
Using celluloid-io 0.14.1
Using erubis 2.7.0
Using json 1.8.1
Using mixlib-log 1.6.0
Using mixlib-authentication 1.3.0
Using net-http-persistent 2.9.4
Using net-ssh 2.8.0
Using solve 0.8.2
Using ffi 1.9.3
Using gssapi 1.0.3
Using httpclient 2.3.4.1
Using little-plugger 1.1.3
Using logging 1.8.2
Using rubyntlm 0.1.1
Using rack 1.5.2
Using httpi 0.9.7
Using nori 1.1.5
Using wasabi 1.0.0
Using savon 0.9.5
Using uuidtools 2.1.4
Using winrm 1.1.3
Using ridley 1.5.3
Using thor 0.18.1
Using berkshelf 2.0.14
Using moneta 0.6.0
Using chef-zero 1.7.3
Using diff-lcs 1.2.5
Using highline 1.6.21
Using mime-types 1.25.1
Using mixlib-cli 1.4.0
Using mixlib-config 2.1.0
Using mixlib-shellout 1.4.0
Using net-ssh-gateway 1.2.0
Using net-ssh-multi 1.2.0
Using ipaddress 0.8.0
Using systemu 2.5.2
Using yajl-ruby 1.2.0
Using ohai 6.22.0
Using coderay 1.1.0
Using method_source 0.8.2
Using slop 3.5.0
Using pry 0.9.12.6
Using puma 1.6.3
Using rest-client 1.6.7
Using chef 11.10.4
Using knife-solo 0.4.1
Installing rails 0.9.5
Using bundler 1.6.1
Your bundle is complete!
It was installed into ./vendor/bundle

rails0.9.5が入ってしまった。
railsのバージョンを確認してみると、エラーになった。。。
$ bundle exec rails -v
(in /Users/xxxx/bundle/vendor/bundle/ruby/2.1.0/gems/rails-0.9.5)
rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
/Users/xxxx/bundle/vendor/bundle/ruby/2.1.0/gems/rails-0.9.5/Rakefile:3:in `require'
/Users/xxxx/bundle/vendor/bundle/ruby/2.1.0/gems/rails-0.9.5/Rakefile:3:in `'
(See full trace by running task with --trace)

Gemfileにrailsのバージョンを指定。
$ vim Gemfile
$ cat Gemfile
source 'https://rubygems.org'
gem 'chef','~> 11.10.0'
gem 'berkshelf'
gem 'knife-solo'
gem 'rails','4.1.0'

bundleを実行してみるとまたエラーが出た。
$ bundle --path vendor/bundle
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    rails (= 4.1.0) ruby depends on
      activesupport (= 4.1.0) ruby
 
    berkshelf (>= 0) ruby depends on
      activesupport (3.2.17)

gem 'rails','4.1.0'を一度コメントアウトして、bundle updateを実行。
$ bundle update
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using addressable 2.3.6
Installing multipart-post 2.0.0 (was 1.2.0)
Installing faraday 0.9.0 (was 0.8.9)
Installing berkshelf-api-client 1.2.0
Using buff-extensions 0.5.0
Using hashie 2.1.1
Using varia_model 0.3.2
Using buff-config 0.4.0
Using buff-ruby_engine 0.1.0
Using buff-shell_out 0.1.1
Using hitimes 1.2.1
Using timers 2.0.0
Installing celluloid 0.16.0.pre (was 0.14.1)
Using nio4r 1.0.0
Installing celluloid-io 0.16.0.pre (was 0.14.1)
Using minitar 0.5.4
Installing sawyer 0.5.4
Installing octokit 3.1.0
Using retryable 1.3.5
Using buff-ignore 1.1.1
Using erubis 2.7.0
Using json 1.8.1
Using mixlib-log 1.6.0
Using mixlib-authentication 1.3.0
Using net-http-persistent 2.9.4
Installing semverse 1.1.0
Installing ridley 3.1.0 (was 1.5.3)
Installing dep-selector-libgecode 1.0.0
Using ffi 1.9.3
Installing dep_selector 1.0.3
Installing solve 1.2.0 (was 0.8.2)
Installing thor 0.19.1 (was 0.18.1)
Installing berkshelf 3.1.2 (was 2.0.14)
Using moneta 0.6.0
Using rack 1.5.2
Using chef-zero 1.7.3
Using diff-lcs 1.2.5
Using highline 1.6.21
Using mime-types 1.25.1
Installing mixlib-cli 1.5.0 (was 1.4.0)
Using mixlib-config 2.1.0
Using mixlib-shellout 1.4.0
Installing net-ssh 2.9.0 (was 2.8.0)
Using net-ssh-gateway 1.2.0
Using net-ssh-multi 1.2.0
Using ipaddress 0.8.0
Using systemu 2.5.2
Using yajl-ruby 1.2.0
Using ohai 6.22.0
Using coderay 1.1.0
Using method_source 0.8.2
Using slop 3.5.0
Using pry 0.9.12.6
Using puma 1.6.3
Using rest-client 1.6.7
Using chef 11.10.4
Using knife-solo 0.4.1
Using bundler 1.6.1
Your bundle is updated!

Gemfileのrailsのコメントアウトを外して、再度bundleを実行。
$ bundle --path vendor/bundle
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.3.1
Using i18n 0.6.9
Using json 1.8.1
Installing minitest 5.3.3
Installing thread_safe 0.3.3
Installing tzinfo 1.1.0
Installing activesupport 4.1.0
Using builder 3.2.2
Using erubis 2.7.0
Installing actionview 4.1.0
Using rack 1.5.2
Installing rack-test 0.6.2
Installing actionpack 4.1.0
Using mime-types 1.25.1
Installing polyglot 0.3.4
Installing treetop 1.4.15
Installing mail 2.5.4
Installing actionmailer 4.1.0
Installing activemodel 4.1.0
Installing arel 5.0.1.20140414130214
Installing activerecord 4.1.0
Using addressable 2.3.6
Using multipart-post 2.0.0
Using faraday 0.9.0
Using berkshelf-api-client 1.2.0
Using buff-extensions 0.5.0
Using hashie 2.1.1
Using varia_model 0.3.2
Using buff-config 0.4.0
Using buff-ruby_engine 0.1.0
Using buff-shell_out 0.1.1
Using hitimes 1.2.1
Using timers 2.0.0
Using celluloid 0.16.0.pre
Using nio4r 1.0.0
Using celluloid-io 0.16.0.pre
Using minitar 0.5.4
Using sawyer 0.5.4
Using octokit 3.1.0
Using retryable 1.3.5
Using buff-ignore 1.1.1
Using mixlib-log 1.6.0
Using mixlib-authentication 1.3.0
Using net-http-persistent 2.9.4
Using semverse 1.1.0
Using ridley 3.1.0
Using dep-selector-libgecode 1.0.0
Using ffi 1.9.3
Using dep_selector 1.0.3
Using solve 1.2.0
Using thor 0.19.1
Using berkshelf 3.1.2
Using bundler 1.6.1
Using moneta 0.6.0
Using chef-zero 1.7.3
Using diff-lcs 1.2.5
Using highline 1.6.21
Using mixlib-cli 1.5.0
Using mixlib-config 2.1.0
Using mixlib-shellout 1.4.0
Using net-ssh 2.9.0
Using net-ssh-gateway 1.2.0
Using net-ssh-multi 1.2.0
Using ipaddress 0.8.0
Using systemu 2.5.2
Using yajl-ruby 1.2.0
Using ohai 6.22.0
Using coderay 1.1.0
Using method_source 0.8.2
Using slop 3.5.0
Using pry 0.9.12.6
Using puma 1.6.3
Using rest-client 1.6.7
Using chef 11.10.4
Installing hike 1.2.3
Using knife-solo 0.4.1
Installing multi_json 1.10.0
Installing railties 4.1.0
Installing tilt 1.4.1
Installing sprockets 2.12.1
Installing sprockets-rails 2.1.3
Installing rails 4.1.0
Your bundle is complete!
It was installed into ./vendor/bundle

正常にrails4.1.0が入ったようなので、バージョンを確認。
$ bundle exec rails -v
Rails 4.1.0


参考URL
http://qiita.com/znz/items/5471e5826fde29fa9a80
http://qiita.com/hirokishirai/items/e38b29a7075459ff6032
http://www.rubylife.jp/rails/ini/index2.html

0 件のコメント:

コメントを投稿