Skip to content

Instantly share code, notes, and snippets.

View satoryu's full-sized avatar
🤘
Put your 🦊 up!

Tatsuya Sato satoryu

🤘
Put your 🦊 up!
View GitHub Profile
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /var/vcap.local/dea/apps/test_rails_app-0-3985c41393373745542574c4088f1f26/app/rubygems/ruby/1.9.1/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:3.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /var/vcap.local/dea/apps/test_rails_app-0-3985c41393373745542574c4088f1f26/app/rubygems/ruby/1.9.1/gems/bundler-1.0.10/lib/bundler/source.rb:162.
NOTE: Gem::SourceIndex#each is deprecated with no replacement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /var/vcap.local/dea/apps/test_rails_app-0-3985c41393373745542574c4088f1f26/app/rubygems/ruby/1.9.1/gems/bundler-1.0.10/lib/bundler/source.rb:162.
/var/vcap.local/dea/apps/test_rails_app-0-3985c41393373745542574c4088f1f26/app/rubygems/ruby/1.9.1/gems/bundler-1.0.10/lib/bundler/runtime.rb:136: warning: Insecure world writable di
satoryu@satou-tatsuya-no-macbook-pro:Projects/test_rails_app] vmc logs test_rails_app
====> logs/stderr.log <====
[2011-10-18 10:08:21] INFO WEBrick 1.3.1
[2011-10-18 10:08:21] INFO ruby 1.9.2 (2011-02-18) [x86_64-linux]
[2011-10-18 10:08:21] INFO WEBrick::HTTPServer#start: pid=21092 port=14128
[2011-10-18 10:11:22] ERROR URI::InvalidURIError: the scheme http does not accept registry part: test_rails_app.cloudfoundry.com (or bad hostname?)
/var/vcap/data/packages/dea_ruby19/4.1/lib/ruby/1.9.1/uri/generic.rb:746:in `rescue in merge'
/var/vcap/data/packages/dea_ruby19/4.1/lib/ruby/1.9.1/uri/generic.rb:743:in `merge'
/var/vcap/data/packages/dea_ruby19/4.1/lib/ruby/1.9.1/webrick/httpresponse.rb:163:in `setup_header'
# encoding: utf-8
class NilClass
def [](_)
nil
end
end
# encoding: utf-8
require 'net/http'
require 'uri'
require 'nokogiri'
page_uri = URI.parse(ARGV[0])
http = Net::HTTP.new(page_uri.host, page_uri.port)
req = Net::HTTP::Get.new(page_uri.path)
$ ruby uri_generic_build.rb "http://www.rakuten.co.jp:1230/"
/Users/satoryu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/generic.rb:421:in `check_port': bad component(expected port component): 1230 (URI::InvalidComponentError)
from /Users/satoryu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/generic.rb:442:in `port='
from /Users/satoryu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/generic.rb:181:in `initialize'
from /Users/satoryu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/generic.rb:126:in `new'
from /Users/satoryu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/generic.rb:126:in `build'
class Hoge
def initialize
@saved_words = []
end
def input
puts 'start'
while (w = gets.chomp) != 'end'
puts 'saved'
@saved_words << w
javax.servlet.ServletContext log: unable to create shared application instance
org.jruby.rack.RackInitializationException: load error: ./config/boot -- java.lang.SecurityException: Google App Engine does not support Runtime.exec
from ./config/environment.rb:7
from ./config/environment.rb:13:in `require'
from config.ru:13
$ vmc files satoryu_blog logs/migration.log
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
No Redis service bound to app. Skipping auto-reconfiguration.
No Mongo service bound to app. Skipping auto-reconfiguration.
No MySQL service bound to app. Skipping auto-reconfiguration.
Loading PostgreSQL auto-reconfiguration.
rake aborted!
PG is not missing constant VERSION!
@satoryu
satoryu / count_utf8.rb
Created April 16, 2012 15:11 — forked from hyoshiok/count_utf8.rb
This script guesses the encoding of a csv file, if it is not ASCII, count number of utf8 of a body and compute utf8 / size.
# encodings: utf-8
=begin :rdoc
= count_utf8.rb
This script guesses the encoding of a csv file and print ratio of utf8 / size of the message
The format of the csv file is the following
id, replied_to_id, thread_id, timestamp, group, recipients, private, user_id, user, email_address, body, url, attachment_ids
production:
adapter: postgresql
<% if CFRuntime::CloudApp.running_in_cloud?
svcname = CFRuntime::CloudApp.servicenamesoftype('postgresql').shift
option = CFRuntime::CloudApp.serviceprops(svcname)
%>
host: <%= option[:host] %>
port: <%= option[:port] %>
database: <%= option[:database] %>
username: <%= option[:username] %>