2016-09-15 80 views
0

我學習的Rails與設計工作,並按照本教程:https://www.sitepoint.com/devise-authentication-in-depth/引導不是在本地主機

在這期間我使用引導-薩斯的造型。我遇到了一個奇怪的問題,即在應用程序位於Heroku上的生產環境中加載樣式,但在我的計算機上進行開發時,我只是得到了空白的未格式化表單。我感覺好像我改變了(或者沒有改變)某個地方的某些設置或版本,但我不確定是什麼。我不確定爲什麼在Heroku上可以正常工作,但是在我自己的電腦上卻沒有問題。

我正在使用Rails 5.下面是我的Gemfile的副本,是否有幫助。我會根據需要提供其他文件/信息。

source 'https://rubygems.org' 

#ruby version 
ruby "2.3.1" 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '~> 5.0.0' 
# Use postgresql as the database for Active Record 
gem 'pg', '~> 0.18' 
# Use Puma as the app server 
gem 'puma', '~> 3.0' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .coffee assets and views 
gem 'coffee-rails', '~> 4.2' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

# Use Bootstrap for styling 
gem 'bootstrap-sass' 

# Use Devise for authentication 
gem 'devise' 

# Fix issues with Bootstrap dropdown menu, Javascript, and Turbolinks 
gem 'jquery-turbolinks' 

# Perform email sending in background 
#gem 'delayed_job_active_record' 


group :development, :test do 
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console 
    gem 'byebug', platform: :mri 
end 

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console' 
    gem 'listen', '~> 3.0.5' 
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    gem 'spring' 
    gem 'spring-watcher-listen', '~> 2.0.0' 
end 

group :test do 
    gem 'rails-controller-testing', '0.1.1' 
    gem 'minitest-reporters',  '1.1.9' 
    gem 'guard',     '2.13.0' 
    gem 'guard-minitest',   '2.4.4' 
end 


# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 

回答

0

我設法解決了我自己的這個問題(它進入了我不斷增長的一堆愚蠢的錯誤)。我沒有按照指示將我的application.css文件重命名爲.scss,而是以我無限的智慧創建了一個新的.scss文件並保留了舊的.css文件。刪除讓Bootstrap樣式自由運行。我不確定爲什麼Heroku在這兩個文件中都沒有問題,我想這足夠聰明瞭解我的愚蠢錯誤。

我也許應該使用新的引導4在​​某些時候,但現在我想我在我所用的教程中的風格。請繼續關注更多幽默的錯誤。