質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

jQuery

jQueryは、JavaScriptライブラリのひとつです。 簡単な記述で、JavaScriptコードを実行できるように設計されています。 2006年1月に、ジョン・レシグが発表しました。 jQueryは独特の記述法を用いており、機能のほとんどは「$関数」や「jQueryオブジェクト」のメソッドとして定義されています。

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

Q&A

1回答

3076閲覧

開発環境、本番環境でのHTML、CSSの反映されないことについて

kokoa

総合スコア8

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

jQuery

jQueryは、JavaScriptライブラリのひとつです。 簡単な記述で、JavaScriptコードを実行できるように設計されています。 2006年1月に、ジョン・レシグが発表しました。 jQueryは独特の記述法を用いており、機能のほとんどは「$関数」や「jQueryオブジェクト」のメソッドとして定義されています。

Ruby on Rails 4

Ruby on Rails4はRubyによって書かれたオープンソースのウェブフレームワークです。 Ruby on Railsは「設定より規約」の原則に従っており、効率的に作業を行うために再開発を行う必要をなくしてくれます。

0グッド

0クリップ

投稿2016/11/17 00:52

Ruby2.2.5
rails4.2.6
Macosx
を使用
herokuにはデプロイ済み

Ruby on RailsでWEBシステムを開発中です。
Herokuにデプロイをし独自ドメインなどで試験運転をしてました。
不具合やレイアウト崩れがあったので、開発環境に切り替えて作業、はじめはrails sコマンドで反映されたのですが、どこかの設定やファイルをいじっくった為に全く、反映されなくなりました。

bundle exec rake assets:cleanやbundle exec rake tmp:cache:clear
rake assets:clobberを行っても意味がなく、開発環境ではapp/assets/stylesheets/application.cssだけの読み込みができません。
やはりlibやpuburicも読み込みに行ってます。
設定変更や、原因、何か良いアドバイスがあればよろしくお願いします!!

もうすこしでWEBサイトの運用が、スタート地点が見えて来た所で、足踏みをしてしまい悔しいです。。

こちらが開発環境のdevelopmentファイルです
Rails.application.configure do

Settings specified here will take precedence over those in config/application.rb.

In the development environment your application's code is reloaded on

every request. This slows down response time but is perfect for development

since you don't have to restart the web server when you make code changes.

config.cache_classes = false

Do not eager load code on boot.

config.eager_load = false

Show full error reports and disable caching.

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

Don't care if the mailer can't send.

config.action_mailer.raise_delivery_errors = false

Print deprecation notices to the Rails logger.

config.active_support.deprecation = :log

Raise an error on page load if there are pending migrations.

config.active_record.migration_error = :page_load

Debug mode disables concatenation and preprocessing of assets.

This option may cause significant delays in view rendering with a large

number of complex assets.

config.assets.debug = true
config.assets.compile = false
config.assets.enabled = false

上記は開発環境時に必要な設定

Asset digests allow you to set far-future HTTP expiration dates on all assets,

yet still be able to expire them through the digest params.

config.assets.digest = false

Adds additional error checking when serving assets at runtime.

Checks for improperly declared sprockets dependencies.

Raises helpful error messages.

config.assets.raise_runtime_errors = true

Raises error for missing translations

config.action_view.raise_on_missing_translations = true

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => 587,
:domain => 'smtp.gmail.com',
:user_name => "///////l.com", #ご自身のgmailアドレス
:password => "///////////", #ご自身のgmailアドレスのパスワード
:authentication => 'login'
}

config.assets.prefix = "/dev-assets"

end

こちらが本番環境のproductionファイルです。

Rails.application.configure do

Settings specified here will take precedence over those in config/application.rb.

Code is not reloaded between requests.

config.cache_classes = true

Eager load code on boot. This eager loads most of Rails and

your application in memory, allowing both threaded web servers

and those relying on copy on write to perform better.

Rake tasks automatically ignore this option for performance.

config.eager_load = true

Full error reports are disabled and caching is turned on.

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

config.cache_classes
config.action_controller.perform_caching
config.action_view.cache_template_loading = false

Enable Rack::Cache to put a simple HTTP cache in front of your application

Add rack-cache to your Gemfile before enabling this.

For large-scale production use, consider using a caching reverse proxy like

NGINX, varnish or squid.

config.action_dispatch.rack_cache = true

Disable serving static files from the /public folder by default since

Apache or NGINX already handles this.

config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

Compress JavaScripts and CSS.

config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass

Do not fallback to assets pipeline if a precompiled asset is missed.

config.assets.compile = true

config.serve_static_files = true

Asset digests allow you to set far-future HTTP expiration dates on all assets,

yet still be able to expire them through the digest params.

config.assets.digest = true

config.assets.precompile and config.assets.version have moved to config/initializers/assets.rb

Specifies the header that your server uses for sending files.

config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache

config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.

config.force_ssl = true

Use the lowest log level to ensure availability of diagnostic information

when problems arise.

config.log_level = :debug

Prepend all log lines with the following tags.

config.log_tags = [ :subdomain, :uuid ]

Use a different logger for distributed setups.

config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

Use a different cache store in production.

config.cache_store = :mem_cache_store

Enable serving of images, stylesheets, and JavaScripts from an asset server.

config.action_controller.asset_host = 'http://assets.example.com'

Ignore bad email addresses and do not raise email delivery errors.

Set this to true and configure the email server for immediate delivery to raise delivery errors.

config.action_mailer.raise_delivery_errors = false

Enable locale fallbacks for I18n (makes lookups for any locale fall back to

the I18n.default_locale when a translation cannot be found).

config.i18n.fallbacks = true

Send deprecation notices to registered listeners.

config.active_support.deprecation = :notify

Use default logging formatter so that PID and timestamp are not suppressed.

config.log_formatter = ::Logger::Formatter.new

Do not dump schema after migrations.

config.active_record.dump_schema_after_migration = false

end

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

gin

2016/11/17 01:29

ひとまず質問文がすごく見づらい状態になっているので、フッターのヘルプを参照しMarkdownで整形お願いします。
guest

回答1

0

こちらを読んでみてはいかがでしょうか。

投稿2016/11/17 02:24

tkmtmkt

総合スコア1800

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問