2013-07-10 28 views
1

我有兩臺機器,Machine1工作得很好。 Machine2是我設置的新機器。 Machine1運行OSX 10.6 Snow Leopard,Machine2運行OSX 10.8 Mountain Lion。我已經將我的項目上傳到Github,所以我應該能夠(在Machine2上)安裝Xcode,自制軟件,git,rvm,ruby,rails。然後,克隆項目,捆綁軟件安裝,rake和瞧,對吧?twitter bootstrap rails在新機器上克隆項目後CSS未加載

不,樣式表未加載。有沒有CSS樣式,所以我檢查瀏覽器,application.css表明這一點:

/* 
* This is a manifest file that'll automatically include all the stylesheets available in this directory 
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 
* the top of the compiled file, but it's generally better to create a new file per style scope. 
*= require_self 
*= require bootstrap_and_overrides 
*= require_tree 
*= require jquery.ui.datepicker 
*= require jquery.facebox 
*/ 

我是不是忘了什麼東西?我跑rails generate bootstrap:install less但仍然沒有骰子。由於某種原因,application.css文件沒有被解釋。

我認爲這可能是Ruby版本的問題,因爲Machine2使用的是Ruby 2.0和Machine1 Ruby 1.9.2,所以我在Machine2上安裝了1.9.2,但仍然是nada。

這都是在開發模式。另外,爲了解決這個問題,我在樣式表中包含了bootstrap_and_overrides樣式表,然後我有了一些樣式!但這顯然不是解決方案。

這裏的一些配置:

的Gemfile

source 'https://rubygems.org' 

gem 'rails', '3.2.3' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'mysql2' 


# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 
    gem 'twitter-bootstrap-rails' 
    gem 'less-rails' 
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    gem 'therubyracer', :platform => :ruby 
    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

development.rb

Experts::Application.configure do 

    config.cache_classes = false 

    config.whiny_nils = true 

    config.consider_all_requests_local  = true 
    config.action_controller.perform_caching = false 

    config.action_mailer.raise_delivery_errors = false 

    config.active_support.deprecation = :log 

    config.action_dispatch.best_standards_support = :builtin 

    config.active_record.mass_assignment_sanitizer = :strict 

    config.active_record.auto_explain_threshold_in_seconds = 0.5 

    config.assets.compress = false 

    config.assets.debug = true 
end 
+2

得到它的工作。我太瞭解新手了,但我刪除了本地項目的副本。確保rvm默認使用Ruby 1.9.2。然後再次克隆該項目。跑了'捆綁安裝',然後我又有了風格!那麼有關於Ruby 2.0的一些事情正在阻礙之中?即使我將其改爲1.9.2,也沒有什麼區別。在運行軟件包安裝之前,我必須擁有1.9.2。我會離開帖子,以防其他人遇到此問題。 –

回答

2

可能降級不太軌版本是一個選擇,我當我遇到問題從1.9.3升級到ruby 2.0.0-p247,並更新所有gem。我在生產中不能預編譯,在將less-rails降級到2.3.3之後,所有作品

+0

我將不得不在我即將收到的計算機上嘗試此解決方案!我會盡快接受你的回答。謝謝! –