SIDEBAR
»
S
I
D
E
B
A
R
«
gem install … แว๊ก ERROR
Jan 12th, 2011 by batt

หลังจากไม่ได้ลง windows ใหม่ปีกว่า…
พอลง ก็ต้องลงโปรแกรมนั่นนี้ และที่สำคัญ Ruby on Rails เครื่องมีทำมาหากิน

ลง ruby ตามปกติผ่านฉลุย ไม่มีอะไรเกิดขึ้น

แต่…. gem install rails(หรืออื่นๆ)

ERROR:? Error installing pg:
The ‘pg’ native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from ‘http://rubyinstaller.org/downloads’ and follow the instructions
at ‘http://github.com/oneclick/rubyinstaller/wiki/Development-Kit’

เหอๆ ยังดีที่บอกว่าให้ทำอะไรบ้าง

ก็ไปโหลด DevKit ตามที่เขาบอกที่ http://rubyinstaller.org/downloads

แล้วทำตามขั้นตอนที่ http://github.com/oneclick/rubyinstaller/wiki/Development-Kit

สรุปให้แบบง่ายๆ unzip DevKit ไว้ที่ไหนก็ได้(แต่ folder ห้ามมีช่องว่าง)
แล้วก็ไปที่ folder นั้น แล้ว run ไฟล์ dk.rb
>> ruby dk.rb init
กับ
>> ruby dk.rb install
เสร็จ

แล้วลอง gem install rails (หรืออื่นๆ) ผ่านฉลุยแน่นอน

Using a proxy with open-uri
Jan 8th, 2011 by batt

ทำโปรเจค EBMWiz? ตอนตั้ง server ไว้ที่ office ก็ใช้งานได้ปกตินี่นา

แต่ทำไมพอย้ายไป server ไปไว้ที่ใน มข. มันใช้ไม่ได้

สงสัยว่าอาจจะต้องใช้ proxy ก่อน

require 'open-uri'
url = 'http://www.pubmed.com/'

proxy_addr = 'http://home.kku.ac.th/proxy.pac:'
proxy_port = '3128'

page = open(url, :proxy => (proxy_addr + proxy_port))

note ไว้ก่อน ลองแล้วได้ผลยังไงจะมา update ให้ฟัง

SIDEBAR
»
S
I
D
E
B
A
R
«
»  Substance:WordPress   »  Style:Ahren Ahimsa