-
Notifications
You must be signed in to change notification settings - Fork 1
/
problem
157 lines (118 loc) · 5.1 KB
/
problem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
Q. Run plugin test
A. rake test:plugins PLUGIN=acts_as_workflowable
Q. how to check machine running under 32bit or 64bit
A. uname -a
If its 32bit then in the output it will be i686 GNU/Linux
If it is 64bit then in the output it will be x86 64 GNU/Linux
Q. Run single test file for plugin
A. rake test:plugins TEST=vendor/plugins/acts_as_workflowable/test/functional/workflows_controller_test.rb
Q. Jquery validation plugins check single element validation
<input type="text" size="47" name="workflow[name]" maxlength="35" id="workflow_name" class="required">
if ( $('#workflow_name').valid())
Q. gem file not loading in netbin using rvm
A. ln -s /home/sandip/.rvm/gems/ruby-1.9.2-p136/ /home/sandip/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/gems/1.9.1
Q. ArgumentError: comparison of Date with ActiveSupport::TimeWithZone failed
use "to_date" method
http://stackoverflow.com/questions/349845/how-to-return-a-date-not-a-timewithzone-from-a-oracle-date-column-in-activereco
Q. Image magick installation problem
A. run configuration file using
./configure CC=c99 CFLAGS=-O2 LDFLAGS='-L/usr/local/lib -R/usr/local/lib' LIBS=-lposix
http://www.imagemagick.org/script/advanced-unix-installation.php
Q. Sphinx Daemon returned error: index event_core,event_delta: syntax error, unexpected '/', expecting $end near '/'
A. User search using Riddle.escape( Event.search])
Event.search Riddle.escape(params[:search])
Q. Thinking sphinx delta is not working, you should update your production env
ThinkingSphinx.deltas_enabled = true
ThinkingSphinx.updates_enabled = true
http://stackoverflow.com/questions/7255941/thinking-sphinx-min-inflex-len-and-delta-not-working-on-production-server
Q. How to fix after application lunch on ubuntu if I click minimize button, then those application are not showing into buttom panel.
A. Click on Add to panel and select "window selector" and click on "add".
Q. How to find included module in an module.
A. ActionController::Base.ancestors
ActionController::Base.included_modules
Q. how to find instace methods of any module
A. A.methods(false)
A.instance_methods(false)
A.private_instance_methods(false)
Q. configure /etc/passwd file related code access
require 'etc'
Etc.instance_methods(false)
Q. How to use manage heroku gem
A. add .gems file in your application
hpricot --version '>= 0.2' --source code.whytheluckystiff.net
Q. crontab rake task is not working
A. instead of use rake give the full path of rake
/usr/bin/rake
Q.How to write crontab
A. crontab -e
Q. session is creation different behaviour, how to fixed that
A. instead of use resources, use resource
map.resource :session
Q. How to include view in model
A. class A < ActiveRecord::Base
include ActionView::Helpers::DateHelper
end
another way
ActionController::Base.helpers.methosd
Q. How to access private methods form subclass
A. class A
def show
puts "public access"
end
private
def display
puts "private access"
end
end
A.new.show => "public access"
A.new.display => NoMethodError: private method `display' called for #<A:0xb76854f4>
A.new.send(:display) => "private access"
B.new.send(:display) => "private access"
A. class A
def show
puts self
display
end
private
def display
puts "private access"
end
end
class B < A
end
B.new.show => "private access" #here display is calling from show method, here display is implecit recever
A. class A
def show
self.display
end
private
def display
puts "private access"
end
end
class B < A
end
B.new.show => NoMethodError: private method `display' called for #<B:0xb78378c4> # here display method is calling from show method, but it take explicit recever
Q. Initialized empty Git repository in /home/sandip/aox-production/.git/
Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
A. ssh-add #every changes in ssh file you should do that
Q. oading development environment (Rails 2.3.2)
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require’: no such file to load — readline (LoadError)
A. sudo apt-get install libncurses5-dev
sudo apt-get install libreadline5-dev
cd /usr/src/ruby-1.8.7-p72/ext/readline
ruby extconf.rb
sudo make
sudo make install
Q. mysqldump from remote machine can access
A. GRANT ALL ON testmate.* TO root@'10.44.234.138' IDENTIFIED BY 'v-training4!@#';
testmate : remote machine database
root@'10.44.234.138 : Localmachine host
v-training4!@# : Local machine password
file_name=testmate_`date +%d-%m-%Y-%H:%M`.sql.gz
mysqldump -h 10.44.233.152 -u root --password='v-training4!@#' testmate | gzip > Production-Database-Backups/$file_name
Q. Cannot allocate memory - svn info /mnt/data/www/MyECF-Web-Application
A. Its problem with memory allcation problem. You have to free your filesize
run the df command and check how much disk are used and how much it is free.