2012年5月30日水曜日

wordpress customfieldに文章を書けるようにする方法。(改行使えたり、リンクタグが飛び出ない)

アンカータグを使うと width 指定した div.wrapからはみ出たりする。 そこで、cssで以下のように white-spaceをしてする。
アンカータグ<a></a>を使うと width 指定した div.wrapからはみ出たりする。


そこで、cssで以下のように white-spaceをしてする。



すると、通常や改行や半角スペースがひとつにまとめられてしまうところ


改行や半角文字として認識してくれる!


http://www.htmq.com/style/white-space.shtml


ただし、


<p>


ちわー


</p>


とか無駄なインデントや改行もそのまま反映されるので、その辺は注意ですね。

2012年5月29日火曜日

instagram-ruby-gem の undefined method `configure' for Instagram:Module(NoMethodError) 続き

$ 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')

に変更。

$ git add . $ git commit -a -m 'changed faraday verstion to 0.7.6 $ git push origin master

これで

Gemfile

'gem 'instagram', :git => 'git://github.com/yahsan2/instagram-ruby-gem.git'

に変更。

再びGem.lockを消して$ bundke install$rails s

できたー!!!!






2012年5月28日月曜日

instagram-ruby-gem の undefined method `configure' for Instagram:Module (NoMethodError)

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)

In Gemfile: instagram (>= 0) ruby depends on multi_json (~> 1.0.3) ruby

Running `bundle update` will rebuild your snapshot from scratch, using onlythe gems in your Gemfile, which may resolve the conflict.

今度はgemどうしで喧嘩。

https://github.com/kylefox/instagram-ruby-gem/commit/95dbe0af2bfe1061aa757bf88726370ccb475ce4

これ読み込んだりこれように、forkなどして変更したがダメ。

とりあえず、gemなおしてgem 'instagram', :git => 'git://github.com/Instagram/instagram-ruby-gem.git'

なんとなく In snapshot (Gemfile.lock):ってあるから、これ全部消して

$bundle install

...

...Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

!! できた!?

$rails s

動いた!!よくわからけど、これで喧嘩収まることもあるらしいです。



ちなみで、https://github.com/mshk/Instagram-on-Rails-Sample

を参考にして、appは作ってったー