こんにちは、宮本です。
お試しで, MarsEditのアプリ使ってます。
よろしくお願いします。感想は後ほど。
$ bundle isntall
できたーと思って
$rails s
起動したら今度は
Bundler could not find compatible versions for gem "faraday":
In snapshot (Gemfile.lock):
faraday (0.8.0)
In Gemfile:
instagram (>= 0) ruby depends on
faraday (= 0.7.6) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
今度はfaradayで喧嘩。
ググる。https://github.com/Instagram/instagram-ruby-gem/issues/33
というわけで、0.7.6にあわせればいいらしい。
forkして、
local に clone
instagram.gemspec
s.add_runtime_dependency('faraday', '0.7.6')
に変更。instagram-ruby-gem を bundle install後、rails sで起動したら、以下のエラーが起きたのでメモ。
/config/initializers/instagram.rb:5:in `<top (required)>': undefined method `configure' for Instagram:Module (NoMethodError)
Gemfile
gem 'instagram'
と記述して
$bundle install
$rails s
で起動。
/config/initializers/instagram.rb:5:in `<top (required)>': undefined method `configure' for Instagram:Module (NoMethodError)
のエラー
ググる。
https://github.com/Instagram/instagram-ruby-gem/issues/21
こちらがヒット。
Gemfile
gem 'instagram', :git => 'git://github.com/Instagram/instagram-ruby-gem.git'
と記述して
$ bundle install
Updating git://github.com/Instagram/instagram-ruby-gem.gitFetching gem metadata from https://rubygems.org/.......Fetching gem metadata from https://rubygems.org/..Bundler could not find compatible versions for gem "multi_json": In snapshot (Gemfile.lock): multi_json (1.3.4)マジ便利やで。
posts 2 posts が まぁ幅広ーくなったかんじ。
// function my_connection_types() {
// Make sure the Posts 2 Posts plugin is active.
if ( !function_exists( 'p2p_register_connection_type' ) )
return;
// Keep a reference to the connection type; we'll need it later
global $people_connection_type;
global $place_connection_type;
global $event_connection_type;
$place_connection_type = p2p_register_connection_type( array(
'from' => 'events',
'to' => 'places'
) );
$people_connection_type = p2p_register_connection_type( array(
'from' => 'events',
'to' => 'people'
) );
$event_connection_type = p2p_register_connection_type( array(
'from' => 'people',
'to' => 'places'
) );
}
add_action( 'init', 'my_connection_types', 100 );
まぁここ見たら書いてあるんですけどね(´・ω・`)
http://wordpress.org/extend/plugins/addquicktag/
function.php
// add custom function to filter hook ‘addquicktag_post_types’
add_filter( 'addquicktag_post_types', 'my_addquicktag_post_types' );
/**
* Return array $post_types with custom post types
*
* @param $post_type Array
* @return $post_type Array
*/
function my_addquicktag_post_types( $post_types ) {
$post_types[] = 'my_custom_post_type1';
$post_types[] += 'my_custom_post_type2';
$post_types[] += 'my_custom_post_type3';
return $post_types;
}
てな感じで,配列にcustompost名をぶち込んでけばよいのだよ.