, 내가 가지고있는 관련 코드 하지만 난 레이크 피가로 입력 오류를 얻을 보호하기 위해 피가로 보석을 사용하고자 할 때 :레일 4 : 피가로의 보석을 사용하여 데이터를 보호 할 수 없습니다 트위터 API를 사용하여 응용 프로그램을 만드는
rake figaro:heroku
rake aborted!
NoMethodError: undefined method `reject' for #<String:0x007ff074af1010>
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/figaro-0.7.0/lib/figaro.rb:39:in `flatten'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/figaro-0.7.0/lib/figaro.rb:17:in `env'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/figaro-0.7.0/lib/figaro/railtie.rb:7:in `block in <class:Railtie>'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:36:in `call'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:44:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.4/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.4/lib/rails/application.rb:67:in `inherited'
/Users/neilpatel/Desktop/Rails/tweetscope/config/application.rb:10:in `<module:Tweetscope>'
/Users/neilpatel/Desktop/Rails/tweetscope/config/application.rb:9:in `<top (required)>'
/Users/neilpatel/Desktop/Rails/tweetscope/Rakefile:4:in `<top (required)>'
에게 Heroku를
keyword.rb 파일
def grab_twitts
client = Twitter::REST::Client.new do |config|
config.consumer_key = "2DZcdTw4p1m2yU18xxxxxxxxx"
config.consumer_secret = <%= ENV["CONFIG.CONSUMER_SECRET"] %>
config.access_token = "71875314-xPOGuWIU7CiDcR3Vx9xxxxxxxxxxxxxxxx"
config.access_token_secret = <%= ENV["CONFIG.ACCESS_TOKEN_SECRET"] %>
end
보석 &가 application.yml
CONFIG.CONSUMER_SECRET = "whpCvjNmePXzj6iSfxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
CONFIG.ACCESS_TOKEN_SECRET = "1P00CJmiQ7Tqhxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
에 다음 정보를 추가 설치 피가로
에 =를 제거한 후 지금 aonther 오류가
사용자/neilpatel/데스크탑/레일/tweetscope/응용 프로그램/모델/keyword.rb : 10 : 구문 오류, 예기치 못한 tCONSTANT, keyword_end ... g을 기대. access_token_secret : < % = ENV [ "CONFIG.ACCESS_TOKEN_SECRET"... ... ^/사용자/neilpatel/데스크탑/레일/웹 사이트/앱/모델/키워드 .rb:10 : 구문 오류, 예기치 않은 '>'/ Users/neilpatel/데스크탑/레일/tweetscope/응용 프로그램/모델/keyword.rb : 34 (일반 및 YAML 파일) keyword_end
class Keyword < ActiveRecord::Base
has_many :tweets
def grab_twitts
client = Twitter::REST::Client.new do |config|
config.consumer_key "2DZcdTw4pvccccccccccccc"
config.consumer_secret <%= ENV["CONFIG.CONSUMER_SECRET"] %>
config.access_token "71875314-xPOGuWIU7CiDcR3Vx9pkJbbbbbbbbbbbbb"
config.access_token_secret: <%= ENV["CONFIG.ACCESS_TOKEN_SECRET"] %>
end
client.search(self.word, :count => 10, :result_type => "recent").take(10).collect do |tweet|
new_tweet = Tweet.new
new_tweet.tweet_id = tweet.id.to_s
new_tweet.tweet_created_at = tweet.created_at
new_tweet.text = tweet.text
new_tweet.user_uid = tweet.user.id
new_tweet.user_name = tweet.user.name
new_tweet.user_screen_name = tweet.user.screen_name
new_tweet.user_image_url = tweet.user.profile_image_url.to_s
new_tweet.keyword = self
new_tweet.save
end
end
end
당신이'사용하여 시도 적이 : 대신이에 제안''='에서'[SO 답변] application.yml' (http://stackoverflow.com/a/20477546/2622934)? – cschroed
예 이제 새로운 오류가 발생했습니다 – Neil