Selected Category: RubyOnRails (5)

View Mode: Post List Post Summary

在freebsd 上裝rails實在很簡單。



# cd /usr/ports/www/rubygem-rails 
# make install clean

// 裝完看一下裝了什麼
# ruby -v
ruby 1.8.7 (2009-04-08 patchlevel 160) [amd64-freebsd7]
# rails -v
Rails 2.3.3
# gem -v
1.3.4
# gem list
*** LOCAL GEMS ***
actionmailer (2.3.3)
actionpack (2.3.3)
activerecord (2.3.3)
activeresource (2.3.3)
activesupport (2.3.3)
hoe (2.3.2)
memcache-client (1.7.4)
rack (1.0.0)
rails (2.3.3)
rake (0.8.7)
rubyforge (1.0.3)
sources (0.0.2)
ZenTest (4.1.3)



但是我遇到下面的問題:


// 跑一支 testapp
# rails testapp
undefined method `camelize' for "app":String


我在這篇找到問題出在ruby-iconv:


// 裝ruby-iconv
# cd /usr/ports/converters/ruby-iconv
# sudo make install clean


有同樣問題可以試試

Posted by beerlee88 at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(60)

Install Ruby 1.9 & Rails 2.3 on Ubuntu

Ruby on Rails 2.3 Release Notes列了一堆,不升上去玩玩怎行。但因為用 apt-get 只到 2.1,想要 2.3 只能手動安裝,裝之前我先把舊的都移乾靜,雖然沒移掉也沒差。

Posted by beerlee88 at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(483)

 1require 'watir' 
 2# the watir controller 
 3# open the IE browser 
 4ie = Watir::IE.new 
 5# Step 1: go to the test site: http://www.google.com 
 6ie.goto("http://www.google.com"
 7# Step 2: enter 'pickaxe' in the search text field 
 8ie.text_field(:name, "q").set("pickaxe"# q is the name of the search field 
 9# Step 3: click the 'Google Search' button 
10ie.button(:name, "btnG").click # "btnG" is the name of the Search button 
11# Actual Result: Check that the 'Programming Ruby' link appears on the results page 
12if ie.contains_text("Programming Ruby"
13  puts "Test Passed. Found the test string: 'Programming Ruby'. Actual Results match Expected Results." 
14else 
15  puts "Test Failed! Could not find: 'Programming Ruby'" 
16end 
17# End of test: Google search

Posted by beerlee88 at 痞客邦 PIXNET Comments(1) Trackback(0) Hits(250)

google "socket post ruby"

google "ruby Net::HTTP post"
Net::HTTP

Posted by beerlee88 at 痞客邦 PIXNET Comments(1) Trackback(0) Hits(511)

1. ROR 連DB table 中"type"不能為column name

Posted by beerlee88 at 痞客邦 PIXNET Comments(8) Trackback(0) Hits(165)