2014-07-12 6 views
9
ruby: 2.0 
rails: 3.2.17 
rspec: 2.14.8 
Database: mysql 

rspec spec बस बिंदुओं को आउटपुट करने के लिए उपयोग किया जाता था।डीएस प्रश्नों को दिखाने के लिए rspec कैसे प्राप्त करें और rails_12factor के साथ बस डॉट्स कैसे प्राप्त करें?

जब मैंने हेरोोकू को धक्का दिया तो मुझे एक बहिष्करण चेतावनी मिल रही थी और हाल ही में rails_12factor मणि को इसके आसपास लाने के लिए जोड़ा गया। हालांकि स्थानीय स्तर पर चश्मे चलाते समय मुझे प्रत्येक लेनदेन के लिए यह वर्बोज़ डीबी आउटपुट मिलता है।
यह एक अच्छा विकल्प है जब मुझे इसकी आवश्यकता है अन्यथा यह बहुत सारे अनियंत्रित और विचलित आउटपुट है।

तो मुझे एक विकल्प चाहिए जो इसे हेरोकू के लिए उपयोग करेगा लेकिन स्थानीय रूप से नहीं।

नोट करें यह फ़ॉर्मेटर का उपयोग करके संबोधित किया गया है, उदा।

rspec spec -fd 

इसके अलावा, अगर वहाँ शब्दाडंबर के इस स्तर के साथ एक त्रुटि है, त्रुटि लगभग हमेशा बंद वर्तमान पृष्ठ ...

09:50:39 durrantm Castle2012 /home/durrantm/Dropnot/_/rails_apps/linker 74093480_wire_up_verify_code 
$ rspec spec/models/link_spec.rb -fd 
Connecting to database specified by database.yml 
... 
Link 
    (0.2ms) BEGIN 
    (0.2ms) SAVEPOINT active_record_1 
    SQL (0.6ms) INSERT INTO `groups` (`created_at`, `group_description`, `group_name`, `updated_at`) VALUES ('2014-07-12 13:50:49', 'Various jQuery examples of common situa 
tions amnd solutions', 'jQuery Examples', '2014-07-12 13:50:49') 
    (0.2ms) RELEASE SAVEPOINT active_record_1 
    (0.2ms) SAVEPOINT active_record_1 
    Link Load (0.6ms) SELECT `links`.* FROM `links` WHERE (links.position IS NOT NULL) AND (1 = 1) ORDER BY links.position DESC LIMIT 1 
    SQL (0.4ms) INSERT INTO `links` (`alt_text`, `content_date`, `created_at`, `group_id`, `position`, `updated_at`, `url_address`, `verified_date`, `version_number`) VALUE 
S ('examples of common situations amnd solutions', NULL, '2014-07-12 13:50:49', 141, 1, '2014-07-12 13:50:49', 'http://test.com', NULL, NULL) 
    (0.1ms) RELEASE SAVEPOINT active_record_1 
    (68.4ms) ROLLBACK 
    should be valid 
    (0.2ms) BEGIN 
    (0.2ms) SAVEPOINT active_record_1 
    SQL (0.3ms) INSERT INTO `groups` (`created_at`, `group_description`, `group_name`, `updated_at`) VALUES ('2014-07-12 13:50:49', 'Various jQuery examples of common situa 
tions amnd solutions', 'jQuery Examples', '2014-07-12 13:50:49') 
    (0.1ms) RELEASE SAVEPOINT active_record_1 
    (0.2ms) SAVEPOINT active_record_1 
    Link Load (0.7ms) SELECT `links`.* FROM `links` WHERE (links.position IS NOT NULL) AND (1 = 1) ORDER BY links.position DESC LIMIT 1 
    SQL (0.5ms) INSERT INTO `links` (`alt_text`, `content_date`, `created_at`, `group_id`, `position`, `updated_at`, `url_address`, `verified_date`, `version_number`) VALUE 
S ('examples of common situations amnd solutions', NULL, '2014-07-12 13:50:49', 142, 1, '2014-07-12 13:50:49', 'http://test.com', NULL, NULL) 
    (0.2ms) RELEASE SAVEPOINT active_record_1 
    (67.6ms) ROLLBACK 
    should have attribute :group_id 
    (0.3ms) BEGIN 
    (0.2ms) SAVEPOINT active_record_1 
    SQL (0.4ms) INSERT INTO `groups` (`created_at`, `group_description`, `group_name`, `updated_at`) VALUES ('2014-07-12 13:50:49', 'Various jQuery examples of common situa 
tions amnd solutions', 'jQuery Examples', '2014-07-12 13:50:49') 
    (0.1ms) RELEASE SAVEPOINT active_record_1 
    (0.2ms) SAVEPOINT active_record_1 
    Link Load (0.5ms) SELECT `links`.* FROM `links` WHERE (links.position IS NOT NULL) AND (1 = 1) ORDER BY links.position DESC LIMIT 1 
    SQL (0.4ms) INSERT INTO `links` (`alt_text`, `content_date`, `created_at`, `group_id`, `position`, `updated_at`, `url_address`, `verified_date`, `version_number`) VALUE 
S ('examples of common situations amnd solutions', NULL, '2014-07-12 13:50:49', 143, 1, '2014-07-12 13:50:49', 'http://test.com', NULL, NULL) 
    (0.1ms) RELEASE SAVEPOINT active_record_1 
    (68.7ms) ROLLBACK 
    should have attribute :url_address 
... 
+0

आप मौके से 'rails_12factor' मणि का उपयोग नहीं कर रहे हैं? – Anthony

+0

यूप, यही वह है। हममम। मेरा मानना ​​है कि मैंने कहा कि जेम हेरोोकू को धक्का देने में आस-पास की चेतावनी के बारे में जानकारी प्राप्त करने के लिए। तो अब मुझे यकीन नहीं है कि क्या करना है। मुझे इस सवाल को अद्यतन करने दें कि मुझे दोनों को संबोधित करने के लिए समाधान की आवश्यकता है। –

उत्तर

20

हम यह भी देखा स्क्रॉल, यह rails_12factor द्वारा उत्पन्न कर रहा है मणि और यह सिर्फ, केवल उत्पादन समूह में यकीन है कि मणि है कि बनाने ताकि तरह से surpressed किया जा सकता है, आम तौर पर:

group :production do 
    gem 'rails_12factor' 
end 

की निर्भरता में से एक 0 rails_stdout_logging नामक एक अन्य मणि है जो आपके द्वारा देखे जा रहे आउटपुट का कारण बन रहा है।

+0

+1 यूप यह वह समाधान है जिसका मैं उपयोग करना चाहता हूं। –

+0

आप परीक्षण में लॉग स्तर को 'चेतावनी' में भी बदल सकते हैं। https://github.com/heroku/rails_stdout_logging#set-log-level –

संबंधित मुद्दे