[英]Upgrading from Rails 3.1 to 3.2 error
我將Rails應用程序從3.1升級到3.2,它將使用gem'twitter-bootstrap-rails'和gem'less'。
嘗試啟動瘦服務器時出現錯誤。
現在我得到這個錯誤。 它說“沒有這樣的文件”,即使我的應用程序中有該文件:
LoadError in Home#index
Showing /Users/burtondav/sites/requestsys/app/views/layouts/application.html.erb where line #20 raised:
no such file to load -- less
(in /Users/burtondav/sites/requestsys/app/assets/stylesheets/bootstrap_and_overrides.css.less)
Extracted source (around line #20):
17: }
18: </style>
19:
20: <%= stylesheet_link_tag "application", :media => "all" %>
21:
22: <!-- Le fav and touch icons -->
23: <link href="/favicon.ico" rel="shortcut icon">
少寶石有什么問題嗎?
謝謝!!
更新
我重新安裝了gem'twitter-bootstrap-rails'。 現在我得到這個錯誤:
Cannot call method 'charAt' of undefined
(in /Users/burtondav/sites/requestsys/app/assets/stylesheets/bootstrap_and_overrides.css.less)
我找到了關於less.js的答案->
https://github.com/cloudhead/less.js/issues/906
但是,我正在使用寶石“ less-rails”
這可能是在less.js中解決的已知問題,而不是在less-rails gem中解決的已知問題嗎?
更新2
我找到了這個
“在sprite.less中,我更改了背景圖片:url(” @ {iconSpritePath}“);和背景圖片:url(” @ {iconWhiteSpritePath}“);
添加“”和{}消除了錯誤..“
但是,那不是鐵軌。
我的路徑是:
// Set the correct sprite paths
@iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings.png");
@iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white.png");
更新3
我找到了另一個答案-升級到Ruby 1.9.3。 我正在使用ruby 1.9.2p290
但是,我很緊張。 我應該緊張嗎? 我的應用仍可以在Heroku上運行嗎?
我要打開一個新問題-這個問題的標題現在不正確。
我隱約記得有這樣的問題。 也許嘗試更少的軌道而不是更少。 我有以下幾點:
gem 'twitter-bootstrap-rails'
gem 'less-rails'
還要確保您擁有(或其他一些javascript解釋器)。
gem 'therubyracer', '0.10.2', :platforms => :ruby
在您的Gemfile中未注釋。 看起來您似乎無法編譯資產
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.