0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

redmineをherokuにpushしようとしたときにエラーが出る

Posted at

こんにちは。

redmine運用してしばらく経過し、Raspberry Piを通さずにredmineを見れないかということになりました。
git cloneして設定ファイルを参考に編集してgit addしてgit commitしました。
あとはpushするだけだなぁと思ってpushしたら残念なことにエラーが出てしまいました。

正しいやり方かどうかは、まだわかっておりませんが
できたため取り急ぎメモです。
駄文です。

以下出たエラー

(LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
ensure you can run `$ bundle exec rake -P` against your app
and using the production group of your Gemfile.
rake aborted!
NoMethodError: undefined method `assets' for #<Rails::Application::Configuration

bundle exec rakeが失敗しており、assetsメソッドが読み込めてないようです。

調べて解決しました。

config/application.rb
require 'sprockets/railtie'

上記のところがコメント(#つき)になっているため外します。

commitしてpushしようとするとまたもエラーが出ます。

Expected to find a manifest file in `app/assets/config/manifest.js

manifest.jsがないと出ます。
railtieを使うようにしたため必要なもののようです。

manifest.jsでは以下のように書くようにとあるのですが、試してもできませんでした。

app/assets/config/manifest.js
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css

フォルダ階層を見直すとpublicの下にあるので以下のように変更します。

app/assets/config/manifest.js
//= link_tree ../../../public/images
//= link_directory ../../../public/javascripts .js
//= link_directory ../../../public/stylesheets .css

commitしてpushした結果とおりました。

あとはセットアップして再起動させます。

heroku run rake db:migrate RAILS_ENV=production
heroku run rake redmine:load_default_data RAILS_ENV=production
heroku restart

追い求めたredmineのページが映し出されて感動しました!

皆さまの助けになれば幸いです。
駄文ですが、最後まで見ていただきありがとうございました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?