Ruby on rails 3 TwitterRubyGem搜索疑难解答

Ruby on rails 3 TwitterRubyGem搜索疑难解答,ruby-on-rails-3,twitter,twitter-gem,Ruby On Rails 3,Twitter,Twitter Gem,我试图用一个特定的标签搜索用户的tweet,其中用户的twitter句柄由Profile模型(@Profile.twitter)上的twitter属性定义 以下是我的控制器中的操作: def profile_twitter @profile = Profile.find(params[:id]) @profile_tweets = Twitter.search(["#hashtag"], [from:"#{@profile.twitter}"]) render :json =>

我试图用一个特定的标签搜索用户的tweet,其中用户的twitter句柄由Profile模型(@Profile.twitter)上的twitter属性定义

以下是我的控制器中的操作:

def profile_twitter
  @profile = Profile.find(params[:id])
  @profile_tweets = Twitter.search(["#hashtag"], [from:"#{@profile.twitter}"])
  render :json => @tweets
end
如果我像下面这样手动执行搜索,它会工作,尽管我在IDE中得到一个
意外的tRPAREN

@profile_tweets = Twitter.search("#hashtag", from:"username")
如果我像下面那样执行搜索(使用twitter属性),则
意外的tRPAREN
会消失,但我会得到
(未定义的[{:from=>“username”}]:数组的方法“merge”)

如果我像下面那样执行搜索(仍然使用twitter属性),我会在IDE中得到一个
意外的tRPAREN
,我会得到
/Users/Travis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:[BUG]分段错误
,然后我的服务器关闭

@profile_tweets = Twitter.search("#hashtag", from:"@profile.twitter")
一开始,执行稍微不同的搜索似乎有效,但随后关闭服务器,出现与上述相同的分段错误:

@profile_tweets = Twitter.search("#hashtag", from:"#{@profile.twitter}")

有没有其他人遇到过这个问题,可以帮助我找到解决方案?

对于其他可能遇到这个问题的人,我在GitHub上打开了这个问题,并从Erik Michaels Ober那里得到了解决方案:

@profile_tweets = Twitter.search("#hashtag from:#{@profile.twitter}")
@profile_tweets = Twitter.search("#hashtag from:#{@profile.twitter}")