Skip to content

Instantly share code, notes, and snippets.

@minimum2scp
Last active December 21, 2015 23:19
Show Gist options
  • Save minimum2scp/6381125 to your computer and use it in GitHub Desktop.
Save minimum2scp/6381125 to your computer and use it in GitHub Desktop.
tdiary-core, tdiary-contrib を git clone して、ローカルのtdiary-coreとtdiary-contribで tdiary を Rack で動かしたい。

/tmp/tdiary に、tdiary-core と tdiary-contrib を git clone する。

% mkdir /tmp/tdiary
% cd /tmp/tdiary
% git clone https://github.com/tdiary/tdiary-core.git
% git clone https://github.com/tdiary/tdiary-contrib.git

こんな感じの構成になる。

/tmp/tdiary
├── tdiary-contrib
└── tdiary-core

/tmp/tdiary/tdiary-core/Gemfile.local を以下の内容で作成する。

gem 'tdiary', :path => '.'
gem 'tdiary-contrib', :path => '../tdiary-contrib'

bundle install は成功するが、rakeやrackup時に例外が発生する。

% cd /tmp/tdiary/tdiary-core
% mkdir -p vendor/bundle
% bundle install --path vendor/bundle --without coffee memcached redis gfm development test
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using bundler (1.3.5) 
Installing daemons (1.1.9) 
Installing eventmachine (1.0.3) 
Installing fastimage (1.5.0) 
Installing hike (1.2.3) 
Installing hikidoc (0.0.6) 
Installing multi_json (1.7.9) 
Installing rack (1.5.2) 
Installing rdtool (0.6.38) 
Installing tilt (1.4.1) 
Installing sprockets (2.10.0) 
Installing thor (0.18.1) 
Using tdiary (4.0.1) from source at . 
Using tdiary-contrib (4.0.1) from source at ../tdiary-contrib 
Installing thin (1.5.1) 
Your bundle is complete!
Gems in the groups coffee, memcached, redis, gfm, development and test were not installed.
It was installed into ./vendor/bundle
% bundle exec rake -vT
There was a LoadError while loading tdiary-contrib.gemspec: 
cannot load such file -- tdiary/version from
  /tmp/tdiary/tdiary-contrib/tdiary-contrib.gemspec:4:in `<main>'

Does it try to require a relative path? That's been removed in Ruby 1.9.
% bundle exec rackup 
There was a LoadError while loading tdiary-contrib.gemspec: 
cannot load such file -- tdiary/version from
  /tmp/tdiary/tdiary-contrib/tdiary-contrib.gemspec:4:in `<main>'

Does it try to require a relative path? That's been removed in Ruby 1.9.

一応、環境変数 RUBYLIB をセットすると動くみたい

% RUBYLIB=`pwd` bundle exec rake -vT
% RUBYLIB=`pwd` bundle exec rackup

本当にこれでいいの?Gemfile.localの書き方に問題がある? あるいはこういった(tdiary-coreもtdiary-contribもローカルにgit cloneしたもので動かしたい)状況に対応できていない?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment