【RoR】Ruby on Rails Part12
■ このスレッドは過去ログ倉庫に格納されています
0001nobodyさん
2011/07/19(火) 13:44:46.30ID:zxrusyvr【Ruby】Ruby on Rails Part11
http://hibari.2ch.net/test/read.cgi/php/1292032736/
■参考サイト
<英語>
本家:http://rubyonrails.org
API document:http://api.rubyonrails.com/
開発者のblog:http://weblog.rubyonrails.org/
参考wiki:http://wiki.rubyonrails.org/rails
http://ruby-toolbox.com/
http://rubygems.org/
http://agilewebdevelopment.com/plugins/top_rated
<日本語>
Rails' wiki: http://wiki.fdiary.net/rails/
http://twitter.com/dhh
http://www.loudthinking.com/
0630nobodyさん
2011/09/24(土) 10:43:39.29ID:???できました。有難うございました。マジ感謝です。
なるほど。これはHTML5関係なんですね。
便利ですね。
0631nobodyさん
2011/09/24(土) 14:12:09.48ID:???http://railscasts.com/episodes/141-paypal-basics
Railscasts - PayPal Notifications
http://railscasts.com/episodes/142-paypal-notifications
Railscasts - PayPal Security
http://railscasts.com/episodes/143-paypal-security
Railscasts - Active Merchant Basics
http://railscasts.com/episodes/144-active-merchant-basics
Railscasts - Integrating Active Merchant
http://railscasts.com/episodes/145-integrating-active-merchant
Railscasts - PayPal Express Checkout
http://railscasts.com/episodes/146-paypal-express-checkout
0632nobodyさん
2011/09/24(土) 18:08:06.72ID:???原因はvalidateじゃなく、validatesだった。sが抜けてた。泣いた。
0633nobodyさん
2011/09/24(土) 18:31:01.78ID:???0634nobodyさん
2011/09/24(土) 18:37:59.64ID:???少し休もう
0635nobodyさん
2011/09/24(土) 21:38:19.99ID:zBp5Lw5xrails consoleで
u = User.includes(:authentications).where('id = 1')
のようにしますと、
=> [#<User id: 1, gender: nil, email: "", encrypted_password: "", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil,
sign_in_count: 4, current_sign_in_at: "2011-08-28 09:48:13", last_sign_in_at: "2011-06-21 13:53:24", current_sign_in_ip: "192.168.0.3", last_sign_in_ip: "192.168.0.5", created_at: "2011-06-20 10:50:38", updated_at: "2011-08-28 09:48:13">]
0636635
2011/09/24(土) 21:40:27.99ID:zBp5Lw5xauthenticationsのデータはどこに格納されているのでしょうか?
u.to_jsonのようにしてみても、Userモデルの情報しか表示されません。
教えていただけますと幸いです。
0637nobodyさん
2011/09/24(土) 22:18:44.17ID:???0638635
2011/09/24(土) 22:42:39.21ID:zBp5Lw5xu.authentications を実行すると
NoMethodError: undefined method `authentications' for #<ActiveRecord::Relation:0x0000000262c990>
となってしまいました・・
使用しているARのバーションは3.1.1.rc1です。
最近アップデートしたのですが、する前からこのような感じでした。。
0639nobodyさん
2011/09/24(土) 22:45:06.31ID:???http://wiki.shopify.com/Creating_an_app_and_deploying_it_to_Heroku
Creating an app and deploying it to Heroku using Rails 3 - Shopify Wiki
http://wiki.shopify.com/Creating_an_app_and_deploying_it_to_Heroku_using_Rails_3
https://www.shopify.com/services/signup
http://addons.heroku.com/chargify
https://devcenter.heroku.com/articles/chargify
https://github.com/npverni/chargify-demo
http://thinkit.co.jp/story/2011/04/01/2067
0640nobodyさん
2011/09/24(土) 22:56:24.70ID:???ネットで断片的に情報をかいつまんでやってたら、
いつまでたってもできないと思うよ。
まずは入門書で少なくともモデルのところを通読するのがお勧め。
0642nobodyさん
2011/09/24(土) 23:07:50.76ID:???paypal-2.0.0.zip
http://web.archive.org/web/20071016063057/http://dist.leetsoft.com/pkg/paypal-2.0.0.zip
http://web.archive.org/web/20071016063057/http://dist.leetsoft.com/pkg/
Paypal library
http://web.archive.org/web/20090123021721/http://dist.leetsoft.com/api/paypal/
0643nobodyさん
2011/09/24(土) 23:10:24.61ID:6AyX50Ec(返値も [ ... ] で囲まれている)
u[0] とか u.first とかしてみたらどうか。
includes は 1-N 問題を回避するためのeager loadingを行うもの。
SELECT "users".* FROM "users"
で必要なuser idを調べて、それに基づいて authentication をイッキする。
SELECT "authentications".* FROM "authentications"
WHERE "authentications"."user_id" IN (1, 2, 3, 4, 5)
joins は SQL の JOIN句。
SELECT "users".* FROM "users"
JOIN authentications ON authentications.user_id = users.id
0644nobodyさん
2011/09/24(土) 23:10:36.73ID:???自動投稿なら当たり前だが
0645nobodyさん
2011/09/24(土) 23:37:12.50ID:???http://rubygems.org/gems/activemerchant
http://activemerchant.org/
Ruby 開発備忘録: railsでpaypalを使う方法
http://face-do.blogspot.com/2011/09/railspaypal.html
Rails3 ActiveMerchantでPayPalの設定 | 超ド素人のRuby on Rails挑戦日記
http://hajimete-ruby.jugem.jp/?eid=73
0646nobodyさん
2011/09/25(日) 00:21:10.55ID:???http://d.hatena.ne.jp/techmedia-think/20090825/1251195366
0647nobodyさん
2011/09/25(日) 00:28:30.48ID:???htmlディレクトリ以下(htmlディレクトリ含む)の権限設定は775でok?
ちなみにrootじゃないユーザーでSSHで入って
アプリを作っていきます。
0648nobodyさん
2011/09/25(日) 00:36:44.25ID:???張ります。
~/wwwの直下に「test」という名前でシンボリックリンクを作ります。
% ln -s $HOME/Rails/test/public $HOME/www/test
http://nyon2.net/archives/2009/01/ruby-on-railsruby-on-rails.html
0649nobodyさん
2011/09/25(日) 00:42:00.72ID:???rootとは別途に作った
sshuserというユーザーでは
rails new test_app を実行したときに
パーミッションエラーが出てしまうので毎回rootで操作しています。
sshuserでsshログインしてアプリを作るときだけsudoするしかないのでしょうか?
またrootでrailsアプリを作ると
別ユーザーのftpuserでftpアクセスしたときに
ファイルの削除が行えません。
皆さんは各種ユーザーはどのように設定していますか?
0650nobodyさん
2011/09/25(日) 01:03:37.05ID:???ftpなんて使わない。
rails以前にlinuxの勉強しなよ。
0651nobodyさん
2011/09/25(日) 03:35:28.07ID:???http://www.google.co.jp/search?num=100&q=paypal+rails+site%3Agithub.com
PayPal sandboxでの日本語アカウントの設定について
http://www.nwlab.com/?p=4641
第3回 定期支払いを実現するリカーリングペイメントの実装
http://gihyo.jp/dev/serial/01/paypal_api/0003
https://github.com/openhood/paypal
https://github.com/nov/paypal-express
http://www.slideshare.net/matake/paypalexpress-ruby-gem
https://paypal-express-sample.heroku.com/
https://github.com/Shopify/active_merchant
http://activemerchant.org/
https://developer.paypal.com/devscr?cmd=_signup-run
0652nobodyさん
2011/09/25(日) 03:36:04.01ID:???http://railscasts.com/episodes/141-paypal-basics
http://d.hatena.ne.jp/hrendoh/20110516/1305548398
http://miya.sblo.jp/article/43672066.html
http://face-do.blogspot.com/2011/09/railspaypal.html
http://hajimete-ruby.jugem.jp/?eid=73
http://d.hatena.ne.jp/techmedia-think/20090825/1251195366
http://d.hatena.ne.jp/ikad/20110616/1308220854
http://blog.twiwt.org/e/624776
https://github.com/recurly/recurly-client-ruby
https://github.com/npverni/chargify-demo
http://wiki.shopify.com/Creating_an_app_and_deploying_it_to_Heroku
0653nobodyさん
2011/09/25(日) 03:58:39.67ID:???https://github.com/nov/paypal-express-sample
https://paypal-express-sample.heroku.com/
Setup Sample App
git clone https://github.com/nov/paypal-express-sample
Get PayPal Sandbox Account
Signup at developer.paypal.com
Create sandbox merchant account
Get API username, password and signature
Edit con?g/paypal.yml
bundle & rails
http://www.slideshare.net/matake/paypalexpress-ruby-gem
0654nobodyさん
2011/09/25(日) 07:15:15.64ID:???https://github.com/spree/spree_paypal_express
https://github.com/pkordel/spree-paypal-express-demo
http://spreecommerce.com/extensions/143-spree_paypal_express
http://spreecommerce.com/extensions/14-spree-paypal-express
http://spreecommerce.com/blog/tag/paypal
https://github.com/spree
http://spreecommerce.com/
https://github.com/nov/paypal-express
0655nobodyさん
2011/09/25(日) 10:39:31.44ID:???https://github.com/wiseleyb/subscription_fu
https://github.com/wiseleyb/subscription_fu_sample_app
Ninjava/PayPal Express Checkout, Subscriptions - Tokyo PayPal Develope... - mochiz blog
http://mochizblog.heroku.com/10
0656nobodyさん
2011/09/25(日) 10:46:54.18ID:???https://github.com/mobalean/subscription_fu
ホーム - モバリーン - ソフトウェア開発・コンサルタント
http://www.mobalean.com/ja
請求書.jp
https://www.seikyusho.jp/
https://github.com/nov/paypal-express
iKnow! - 覚えやすく、忘れにくい、確実に身につく英語学習サービス
http://iknow.jp/
0657nobodyさん
2011/09/25(日) 11:01:29.30ID:???https://github.com/tc/paypal_adaptive
0658nobodyさん
2011/09/25(日) 11:40:35.32ID:???http://hajimete-ruby.jugem.jp/?eid=73
Cody Fauser - PayPal Express Payments with ActiveMerchant
http://www.codyfauser.com/2008/1/17/paypal-express-payments-with-activemerchant
Active Merchant + Paypal Recurring Payment | Naive Hack
http://www.naivehack.com/2010/11/24/active-merchant-paypal-recurring-payment/
Requesting PayPal API Signature - Online documentation - WildApricot help
http://help.wildapricot.com/display/DOC/Requesting+PayPal+API+Signature
0659635
2011/09/25(日) 15:04:21.72ID:vRBCORhD>>640
ですよね。rails3本買ってみることにします。
>>641
ありがとうございます!これが知りたかったのでした。
>>643
詳しいご説明ありがとうございます。
eager loadingについても調べてみてincludesとjoinsの違いがなんとなく分かって来ました。
0660nobodyさん
2011/09/25(日) 23:11:29.94ID:???http://face-do.blogspot.com/2011/09/railspaypal.html
signup
https://developer.paypal.com/devscr?cmd=_signup-run
Create a preconfigured account
https://developer.paypal.com/cgi-bin/devscr?cmd=_create-account-session
API Username API Password Signature
https://developer.paypal.com/cgi-bin/devscr?cmd=_certs-session
https://developer.paypal.com/cgi-bin/devscr?cmd=home/main
https://www.sandbox.paypal.com/
http://www.codyfauser.com/2008/1/17/paypal-express-payments-with-activemerchant
http://www.naivehack.com/2010/11/24/active-merchant-paypal-recurring-payment/
0661nobodyさん
2011/09/25(日) 23:13:42.48ID:???0662nobodyさん
2011/09/26(月) 01:56:11.13ID:???http://nerbie69.blogspot.com/2008/11/recurring-payments-using-paypal-express.html
paypal_express_recurring_nv.rb
http://www.gotripod.com/2008/09/08/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/
http://rayvinly.com/articles/2009/02/20/paypal-recurring-billing-with-activemerchant-in-ruby-on-rails/
http://intridea.com/2009/2/23/paypal-recurring-billing-with-activemerchant-in-ruby-on-rails?blog=company
https://github.com/rayvinly/active_merchant/
0663nobodyさん
2011/09/26(月) 10:19:53.93ID:???https://github.com/vantran/active_merchant
http://www.naivehack.com/2010/11/24/active-merchant-paypal-recurring-payment/
http://nerbie69.blogspot.com/2008/11/recurring-payments-using-paypal-express.html
http://www.gotripod.com/2008/09/08/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/
https://github.com/railsdog/spree-paypal-express
https://github.com/spree/spree_paypal_express
https://github.com/nov/paypal-express
https://github.com/fnando/paypal-recurring
0664nobodyさん
2011/09/26(月) 20:08:08.60ID:???password_fieldに入力した文字だけ再表示されません。(●●●●も表示されない。)
■ソース
<%= form_for @user,:url => { :action => 'hogehoge'} do |f| %>
<%= f.password_field :password, {:size => 20, :maxlength => 20, :required => true} %>
#@user[:password]には、文字列として'hogehoge'が登録されている。
何か別途指定する必要ありますか?
0665nobodyさん
2011/09/26(月) 20:10:51.40ID:???もう一度入力させます。
0666nobodyさん
2011/09/26(月) 20:33:43.12ID:???0667nobodyさん
2011/09/27(火) 20:02:10.26ID:???railsがいかに人気が無いか表してる
0668nobodyさん
2011/09/27(火) 21:28:06.81ID:???質問してるのは、ネットだけで何とか習得しようという初心者だし。
質問もはてなとかTwitterで聞いた方が早いし。
あとリンク貼り付けるだけの人力botの存在とか。
0669nobodyさん
2011/09/27(火) 22:03:51.28ID:???0670nobodyさん
2011/09/27(火) 22:07:31.37ID:???0671nobodyさん
2011/09/28(水) 00:47:03.04ID:???既存クラスの拡張も容易だから、気に入らない部分はモンキーパッチも簡単にあてられるし
0672nobodyさん
2011/09/28(水) 01:01:13.66ID:???0673nobodyさん
2011/09/28(水) 01:50:19.68ID:W++Lg7ZHhttp://d.hatena.ne.jp/sotarok/20070627/1182959279
Reuben Yau ? Blog Archive ? Google Analytics Hack - obtaining full referring URL
http://www.reubenyau.com/google-analytics-hack-obtaining-full-referring-url/
0674nobodyさん
2011/09/28(水) 02:00:39.65ID:W++Lg7ZHhttp://b.hatena.ne.jp/otsune/20091020#bookmark-16845957
0675nobodyさん
2011/09/28(水) 02:06:43.28ID:W++Lg7ZHHow do I see the full URL of my pages in my reports? - Analytics Help
http://www.google.com/support/googleanalytics/bin/answer.py?answer=55511&topic=11032
0676nobodyさん
2011/09/28(水) 04:19:26.67ID:W++Lg7ZHhttp://blog.mudaimemo.com/2008/10/ruby-on-rails-view.html
word_wrap('Once upon a time', 8) # => Once upon\na time
truncate("Once upon a time in a world far far away")
# => "Once upon a time in a world..."
http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-truncate
auto_link("Go to http://www.rubyonrails.org and say hello to [email protected]")
http://apidock.com/rails/ActionView/Helpers/TextHelper/auto_link
0677nobodyさん
2011/09/28(水) 04:39:44.69ID:???https://www.fluxflex.com/
http://www.heroku.com/
http://cloudfoundry.com/
http://www.engineyard.com/
http://www.slicehost.com/
http://www.rackspace.com/
http://www.linode.com/
0678nobodyさん
2011/09/28(水) 04:41:58.13ID:???0679nobodyさん
2011/09/28(水) 04:53:56.87ID:???http://aws.amazon.com/jp/ec2/
Amazon Relational Database Service (Amazon RDS)
http://aws.amazon.com/jp/rds/
Amazon Simple Storage Service (Amazon S3)
http://aws.amazon.com/jp/s3/
0680nobodyさん
2011/09/28(水) 04:56:52.18ID:???http://cloud.sakura.ad.jp/
さくらのVPS|VPS(仮想専用サーバ)はさくらインターネット
http://vps.sakura.ad.jp/
0681nobodyさん
2011/09/28(水) 05:00:28.12ID:???Cloud FoundryにRails/Sinatra/Nodeアプリをデプロイしてみた - 準二級.jp
http://june29.jp/2011/04/24/rails-sinatra-node-on-cloudfoundry/
さくらインターネットで無理矢理Rails動かすくらいならRackspace使えばよいと思う | maeda.log
http://maeda.farend.ne.jp/blog/2010/01/09/rackspace/
さくらのクラウド、Amazon EC2の半額以下で11月開始へ − @IT
http://www.atmarkit.co.jp/news/201109/06/sakura.html
One Click Install Software Library
WordPress 3.1.3 (Japanese) Redmine 1.2-stable
http://www.fluxflex.com/library
0682nobodyさん
2011/09/28(水) 06:06:05.40ID:???http://bitnami.org/stack/rubystack
0684nobodyさん
2011/09/29(木) 00:25:58.66ID:???Rails3.1にてフォームボタンを押下した後、次のページに遷移するまで
そのボタンの横で
ビジーのインジケーターをくるくる回すにはどのような手順を踏めばいいかな?jquery?
0685nobodyさん
2011/09/29(木) 01:21:33.83ID:???0686nobodyさん
2011/09/29(木) 08:33:40.18ID:???ページ移動するんだから後のことは考えなくていい
戻るボタン?知るか。
0687nobodyさん
2011/09/29(木) 09:29:25.66ID:???http://blog.heroku.com/archives/2011/9/28/python_and_django/
0688nobodyさん
2011/09/29(木) 11:10:22.51ID:???http://d.hatena.ne.jp/R-H/20110928
0689nobodyさん
2011/09/30(金) 11:15:59.92ID:???require 'rubygems'
require 'active_record'
require 'open-uri'
ActiveRecord::Base.establish_connection( :adapter => 'sqlite3', :database => 'test.db')
class Download < ActiveRecord::Base ; end
ActiveRecord::Schema.verbose = false
ActiveRecord::Schema.define do
create_table "downloads", :force => true do |t|
t.column :image, :binary
end
end
record = Download.new
open('http://www.jreast.co.jp/map/pdf/map_tokyo.pdf') do |page|
image = page.read
File.open("image1.pdf",'w'){|fh| fh.puts image}
record.image = image
record.save
end
record = Download.first
File.open("image2.pdf",'w'){|fh| fh.puts record.image}
上のコードでimage1、image2は問題なくAcrobat等で開けます。ところが、
sqlite3 test.db 'select image from downloads where id = 1;' > image3.pdf
とシェルからやるとimage3はpdfとして認識されません(壊れている?)ActiveRecordのバイナリとsqlite3のblobの扱いの理解の足りなさに原因があるとは思いますが、image3をきちんと開くための方法を教えてください。
(要するにrubyであつかったバイナリデータを他の言語等で受け継いで扱いたいのです。)
環境はruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]、activerecord (3.0.1)、sqlite3 (3.6.12) OSX10.6です。
0690nobodyさん
2011/09/30(金) 12:58:48.94ID:???0691689
2011/09/30(金) 13:13:17.38ID:???あるいはリダイレクトの仕方に問題が?
201074 Sep 30 11:58 image1.pdf
201074 Sep 30 11:58 image2.pdf
204123 Sep 30 11:58 image3.pdf
0692nobodyさん
2011/09/30(金) 14:44:53.90ID:???バイナリじゃなくて文字に変換されてたりするんじゃないのか?
0693nobodyさん
2011/09/30(金) 16:10:24.42ID:???(必ず整形が入る)
print Download.find(ARGV[0]).image
みたいなスクリプトを書いて、rails runner で動かすのが一番簡単かな
0694689
2011/09/30(金) 16:47:54.83ID:???適切なアドバイスありがとうございました。結局BLOBはバイナリそのままではないようですね。
同じSQLiteのDBをC言語などであつかうつもりですのでいったんBase64でエンコードしてから保存することにしました。
SQLiteの性質を十分には把握していなかったようです。あるいみActiveRecodeの楽さかげんが際立ってしまった。
0695nobodyさん
2011/09/30(金) 17:00:09.32ID:???http://netafull.net/marketing/038710.html
0697nobodyさん
2011/09/30(金) 23:12:48.17ID:d8ot3xr3必要なものは優先的にvendorの中を覗きにいくようになるのでしょうか?
それともRails本体の中にあるgemを優先的に覗きにいくのでしょうか?
0698nobodyさん
2011/09/30(金) 23:29:01.99ID:???残念だ
0699nobodyさん
2011/09/30(金) 23:38:21.30ID:???管理者用のscaffoldへのアクセス制限は
どのような仕組みでかけてますか?
0700nobodyさん
2011/10/01(土) 00:17:11.40ID:???0702nobodyさん
2011/10/01(土) 00:49:31.54ID:???0703nobodyさん
2011/10/01(土) 02:48:44.76ID:ENlvmGfRscript/rails runner 'puts $:'
0704nobodyさん
2011/10/01(土) 14:19:47.79ID:???0705nobodyさん
2011/10/01(土) 14:23:39.48ID:???0706nobodyさん
2011/10/01(土) 14:26:57.62ID:???OSのバージョンとかは書いてね
0707nobodyさん
2011/10/01(土) 14:58:16.00ID:ENlvmGfR0708nobodyさん
2011/10/01(土) 15:43:13.73ID:???MacにphpMyAdminいれて鯖を作りたいです
どうすればいいですか?
0710nobodyさん
2011/10/01(土) 15:55:30.50ID:ENlvmGfR0711nobodyさん
2011/10/01(土) 16:20:48.80ID:???0714nobodyさん
2011/10/01(土) 19:26:44.60ID:???0715704
2011/10/01(土) 19:50:30.99ID:???http://www.oiax.jp/rails/rails3.html を参考にして"第12回: ユーザー認証(1)"までなんとかたどり着いたのですが、
この第12回の中盤のDeviseをbundle installする過程でつまずきました。
http://www.oiax.jp/rails/rails3/authentication1.html にあるように
Gemfileに 「gem 'devise', '1.1.2'」の一文を追加し、ターミナルにてbundle installを実行したところ、
以下のようなエラーを吐いてしまいました。
「devise v1.1.2はこのバージョンのrubyに対応してないぞ」と言われてる気がするんですが、
これはrubyのバージョンを下げてしまうべきですか?
それとも対応した新しいバージョンのdeviseが出てたりするんですか?
初心者で申し訳ないですが、誰か分かる方いらっしゃいましたら教えてください。。
Ore-no-Imouto-no-MacBook-Pro:nchak hiro$ bundle install
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "bcrypt-ruby":
In snapshot (Gemfile.lock):
bcrypt-ruby (3.0.1)
In Gemfile:
devise (= 1.1.2) ruby depends on
bcrypt-ruby (~> 2.1.2) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
0716nobodyさん
2011/10/01(土) 20:00:55.44ID:???あと、そのrubyってどうやって入れた?もしくは元から入ってたやつ?
0717704
2011/10/01(土) 20:16:43.45ID:???http://www.oiax.jp/rails/zakkan/rails_3_1_installation_on_macosx.html
railsの環境は上の記事を参考にして整えました。
当方の環境がOSX v10.7.1 Lionでしたので、"Rubyを更新"というステップは飛ばし、元から入っていたバージョンを使っています。
一応コマンドもやってみました。
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
0718nobodyさん
2011/10/01(土) 20:52:12.94ID:ENlvmGfRbcrypt-ruby (暗号化に関するgem)の、
deviseが期待するバージョンでは条件を満たせないと言っている。
Rails 3.1 は ActiveModel の特定のバージョン (=3.1.0) のみを使う。
ActiveModel 3.1.0 は bcryt-ruby の特定のバージョン( ~> 3.0.0) を必要とする。
で、あなたの入れようとしたdevise は ~> 2.1.2 という条件の bcryp-ruby を
使うといっているわけだ。 ~> ってのは、ドットで区切った上位の数値が同じで
あれば、下の方のバージョンだけはより大きなものでもいい、という指定で、
残念ながら 3.x では ~> 2.1.2 という条件を満たせない(3は2より大きいが最上
位が違うのは受け入れられないので)
Rails 3.1.1 (rc2) は bcrypt-ruby を必須gemから外しているからなんとか
なるかもしれないけど… 勉強に rc ってのもな…
0719nobodyさん
2011/10/01(土) 20:54:26.04ID:ENlvmGfRhttps://github.com/plataformatec/devise/blob/master/devise.gemspec
0720nobodyさん
2011/10/01(土) 21:01:28.61ID:???その記事と、もしかしたら挙動が違うかも知れんが。
あと今後の事を考えると、rubyはデフォルトのじゃなくて rvmで入れた方が良いかも。
0721nobodyさん
2011/10/01(土) 21:03:44.28ID:???0722nobodyさん
2011/10/01(土) 21:05:49.15ID:ENlvmGfRその点でも、新しいの入れたほうがいいな。
$ /usr/bin/ruby -vKu -e 'p "あいうえお"'
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
"あいうえ¥343¥201¥212"
p250で直ってるところが残念すぐる。
0723nobodyさん
2011/10/01(土) 21:22:06.54ID:???日本語はpじゃなくてputsしてるし。
0724704
2011/10/01(土) 21:44:13.35ID:???詳しくありがとうございます!
つまり、Railsを最新のRC版に更新したとしても、
Rubyじゃなくてbcrypt-rubyのバージョンをv3.0.0以下に下げなくてはいけないという事なんですね。。
>721
>>ruby は1.9.2以上で
やっぱ新しくすべきですか。
ちなみにv1.9.2とv1.9.3(RC1)のどちらがおすすめですか?
0725704
2011/10/01(土) 21:44:28.65ID:???バグ!!なるほど・・・よく分からないけど
## test.rb ##
arr = Hash.new
arr["No-001"] = "春"; arr["No-002"] = "夏"; arr["No-003"] = "秋"; arr["No-004"] = "冬"
p(arr)
for n in arr; print("KEY:", n[0], " --> VALUE:", n[1], "\n"); end
## /test.rb ##
を実行すると、
$ ruby test.rb
{"No-001"=>"\346\230\245", "No-002"=>"\345\244\217", "No-003"=>"\347\247\213", "No-004"=>"\345\206\254"}
KEY:No-001 --> VALUE:春
KEY:No-002 --> VALUE:夏
KEY:No-003 --> VALUE:秋
KEY:No-004 --> VALUE:冬
って感じに、p(arr)の出力が数字になるのもRubyのバージョンの問題なんですかね?
0726704
2011/10/01(土) 21:45:08.63ID:???Gemfileのバージョンの部分を削ったらとりあえずエラー出ずに通りました!!
$ bundle install
Fetching source index for http://rubygems.org/
Enter your password to install the bundled RubyGems to your system:
Using rake (0.9.2)
Using multi_json (1.0.3)
Using activesupport (3.1.0)
Using bcrypt-ruby (3.0.1)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.0)
Using erubis (2.7.0)
Using rack (1.3.3)
Using rack-cache (1.0.3)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.0)
Using actionpack (3.1.0)
Using mime-types (1.16)
0727704
2011/10/01(土) 21:47:11.49ID:???Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.0)
Using arel (2.2.1)
Using tzinfo (0.3.30)
Using activerecord (3.1.0)
Using activeresource (3.1.0)
Using bundler (1.0.20)
Using coffee-script-source (1.1.2)
Using execjs (1.2.9)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using rdoc (3.9.4)
Using thor (0.14.6)
Using railties (3.1.0)
Using coffee-rails (3.1.1)
Installing orm_adapter (0.0.5)
Installing warden (1.0.5)
Installing devise (1.4.7)
Using jquery-rails (1.0.14)
Using json (1.6.1)
Using rails (3.1.0)
Using sass (3.1.7)
Using sass-rails (3.1.3)
Using sqlite3 (1.3.4)
Using sqlite3-ruby (1.3.3)
Using uglifier (1.0.3)
Using will_paginate (3.0.pre2)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
0728704
2011/10/01(土) 21:48:50.08ID:???てかrvmというものがあるんですね!
ググってみたら http://gihyo.jp/dev/serial/01/ruby/0039 というページが出てきたんですけど、
よくわからないんですがこの通りにやればいいですか?
0729nobodyさん
2011/10/01(土) 22:07:58.87ID:???まあ、大体そんな感じ。
Lionでは、その記事のreadlineの部分は無視していい。
homebrew使ってるなら
$ brew install readline
しといても害は無い。どうせ他に何か入れた時に入るから。
ruby のバージョンは 1.9.2 と 1.9.3 と迷いどころだけど、1.9.3-head (もしくは1.9.2-head)としとけば良いような気もする。
あと毎回 rvm use するのが面倒なら、.rvmrc ファイルを作る。
前に挙げてた記事の通りやっているのだと、workディレクトリ作ってその下で作業員してるかも知れない。
その場合、
$ cd work
$ echo '1.9.3-head' > .rvmrc
$ cd ..
$ cd work
するとなんか聞かれるから、yと答えて。
そうするとworkにcd すれば自動で
1.9.3-head使うようになるから。
0730nobodyさん
2011/10/01(土) 22:28:23.84ID:???■ このスレッドは過去ログ倉庫に格納されています