我是一个DB菜鸟,所以请和我好心.
我有一些问题通过点击gem将我的SQLite DB推送到Heroku.与他们交谈,他们告诉我其中一个解决方案可能是将我的数据库从SQLite转换为PostgreSQL.有一个简单的方法吗?
谢谢
更多信息: - 来自Rails应用程序的数据库 - 我在Mac OS X上 - 刚刚通过macports安装了PostgreSQL
当在iframe中加载画布应用程序时,不显示任何内容,并且在Chrome Firebug控制台上我看到错误:
拒绝显示文档,因为X-Frame-Options禁止显示.

我尝试了这个解决方案:克服"X-Frame-Options禁止显示"
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_xframeoption
def set_xframeoption
response.headers["X-Frame-Options"]='GOFORIT'
end
end
Run Code Online (Sandbox Code Playgroud)
但我有同样的错误.有解决方案吗
谢谢
- FB Resquest Header -
GET /dropis_app/ HTTP/1.1
Host: apps.facebook.com
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: [lot of stuff]
- FB Response Header -
HTTP/1.1 200 OK
Cache-Control: private, no-cache, no-store, must-revalidate
Expires: Sat, 01 Jan 2000 00:00:00 GMT
P3P: …Run Code Online (Sandbox Code Playgroud) 是否有Javascript事件来跟踪当前标签的"失去焦点"?
javascript analytics google-analytics event-handling javascript-events
我怎么能在Ruby上做到这一点?
puts some_method("ò")
# => "ò"
Run Code Online (Sandbox Code Playgroud)
换句话说,将重音字符转换ò为HTML版本:ò
我试过这样的:
# coding: utf-8
require 'rubygems'
require 'htmlentities'
require 'unicode'
coder = HTMLEntities.new
string = "Scròfina"
puts coder.encode(string, :named)
Run Code Online (Sandbox Code Playgroud)
但是我得到了这个(来自:http://htmlentities.rubyforge.org/):
/Library/Ruby/Gems/1.8/gems/htmlentities-4.2.0/lib/htmlentities/encoder.rb:85:in `unpack': malformed UTF-8 character (expected 2 bytes, given 1 bytes) (ArgumentError)
from /Library/Ruby/Gems/1.8/gems/htmlentities-4.2.0/lib/htmlentities/encoder.rb:85:in `encode_decimal'
from (eval):2:in `encode_extended'
from /Library/Ruby/Gems/1.8/gems/htmlentities-4.2.0/lib/htmlentities/encoder.rb:18:in `encode'
from /Library/Ruby/Gems/1.8/gems/htmlentities-4.2.0/lib/htmlentities/encoder.rb:18:in `gsub!'
from /Library/Ruby/Gems/1.8/gems/htmlentities-4.2.0/lib/htmlentities/encoder.rb:18:in `encode'
from /Library/Ruby/Gems/1.8/gems/htmlentities-4.2.0/lib/htmlentities.rb:74:in `encode'
from unicode_pleasure.rb:8
Run Code Online (Sandbox Code Playgroud)
感谢您的时间!
我已经安装了Selenium IDE(Firefox插件)和Capybara(gem).我现在正在我的rails应用程序中从Cucumber/Capybara步骤(@javascript)驾驶Selenium.
问题是:
我可以将Selenium IDE步骤导出为Cucumber/Capybara步骤吗?
在Selenium IDE选项>格式中我只能看到Ruby(Test :: Unit)和RSpec,但是拥有Capybara格式也会很棒.
谢谢.
我的意思是"Facebook之旅":

可能与Facebook CSS开箱即用.
我已经知道这两个了:
两者都缺失:"焦点效果"(焦点部分更轻),Facebook CSS,顶部的旅游栏
关于CSS:一个可能的解决方案可能是http://ckrack.github.com/fbootstrapp/#popovers但是Modals并不是我想要的(它更像是一个弹出窗口,没有箭头,没有"焦点效果")
谢谢
我正在尝试使用twitter4r,但我遇到了一些问题:
为什么我无法在IRB中加载gem?
$ sudo gem install twitter4r
Successfully installed twitter4r-0.3.2
1 gem installed
Installing ri documentation for twitter4r-0.3.2...
Installing RDoc documentation for twitter4r-0.3.2...
$ irb
>> require 'rubygems'
=> false
>> require 'twitter4r'
LoadError: no such file to load -- twitter4r
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`require'
from (irb):2
我已经下载了http://files.rubyforge.vm.bytemark.co.uk/twitter4r/twitter4rails.post-0_2_4.zip 应用程序,它只适用于twitter4r-0.2.4而不适用于最新版本的twitter4r-0.3. 2:
$ script/server ./script/../config/boot.rb:26:Warning: Gem::SourceIndex#search support for String patterns is deprecated, use #find_name => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Call …
自从我从Leopard迁移到Snow Leopard后,我得到了
$ ruby script/server
Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org
Run Code Online (Sandbox Code Playgroud)
使它工作的唯一方法是:
$ /usr/bin/ruby script/server
=> Booting Mongrel
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
Run Code Online (Sandbox Code Playgroud)
所以我想我的路径被破坏了,这是我的〜/ .profile文件fyi:
##
# DELUXE-USR-LOCAL-BIN-INSERT
# (do not remove this comment)
##
echo $PATH | grep -q -s "/usr/local/bin"
if [ $? -eq 1 ] ; then
PATH=$PATH:/usr/local/bin
export PATH
fi
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
PATH="/usr/local/mysql/bin:$PATH"
PATH="/opt/local/bin:/opt/local/sbin:$PATH"
PATH="/usr/local/bin:/usr/local/sbin:$PATH"
export PATH
export GEMDIR=`gem env gemdir`
我怎样才能解决这个问题?
ruby ×3
rubygems ×3
.profile ×1
analytics ×1
capybara ×1
css ×1
cucumber ×1
facebook ×1
heroku ×1
http-headers ×1
javascript ×1
jquery ×1
macos ×1
postgresql ×1
selenium ×1
selenium-ide ×1
sqlite ×1
twitter ×1
utf-8 ×1