Archive for the Category: ' Ruby on Rails '

Статья написана автором Галиев Руслан

Webrisk error

В консоли при каждом запросе выдается предупреждение

1
WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true</span>

Ошибка связана с проблемой в сервере , решается исправлением файла lib/webrick/httpresponse.rb. 

Решение

Статья написана автором Галиев Руслан

Проблема при запуске сервера Rails

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
root@zabbix:~/ruby/demo_app# rails s
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a Ja vaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavai lable)
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/execjs-1.4.0/lib/execjs.rb:5:in `
&lt;module:ExecJS&gt;'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/execjs-1.4.0/lib/execjs.rb:4:in `&lt;top (required)&gt;'

from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `
&lt;top (required) &gt;'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'

from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `&lt;top (required) &gt;'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `
require'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `&lt;top (required)&gt;'

from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `
block (2 le vels) in require'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'

from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `block in re quire'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `
each'
from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require'

from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.1/lib/bundler.rb:128:in `require'
from /root/ruby/demo_app/config/application.rb:7:in `
&lt;top (required)&gt;'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'

from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in &lt;top (req uired)&gt;'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:50:in `
tap'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.8/lib/rails/commands.rb:50:in `&lt;top (required)&gt;'

from script/rails:6:in `require'
from script/rails:6:in `
&lt;main&gt;'

Решена следующим набором команд, операционная система Debian

1
2
3
4
5
6
apt-get install python g++ make
mkdir ~/nodejs && cd $_
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd `ls -rd node-v*`
./configure
make install