Page 106 of 165

Aktualizacja meta_where do squeel’a i private method `desc’ called for :created_at:Symbol

Po przejściu z meta_where na Squeela (nowy gem twórców meta_where), możemy dostać taki oto komunikat podczas odpalania naszej aplikacji:

<class:InfoBox>': private method desc' called for :created_at:Symbol (NoMethodError)

Oto fragment kodu, który powoduje błąd:

default_scope where("status != 'Deleted'").order(:created_at.desc)

aby to naprawić, dodajemy nowy initializer a w nim:

Squeel.configure do |config|
  config.load_core_extensions :symbol
end

Rails 3.1 beta rc2 – Could not find a JavaScript runtime

Uruchamiając aplikację na Railsach 3.1beta rc2 możemy dostać taki błąd:

.rvm/gems/ruby-1.9.2-head@gems/execjs-1.1.1/lib/execjs/runtimes.rb:43:
in `autodetect': Could not find a JavaScript runtime. 
See https://github.com/sstephenson/execjs for a list of available runtimes.
(ExecJS::RuntimeUnavailable)

Rozwiązanie jest bardzo proste, dodajemy therubyracer do gemfilea:

gem 'therubyracer'

odpalamy:

bundle install

i problem znika :)

 

Copyright © 2024 Closer to Code

Theme by Anders NorenUp ↑