rake aborted! Uglifier::Error: Unexpected character '`' のエラー
サーバー側でrake assets:precompile RAILS_ENV=production すると
rake aborted!
Uglifier::Error: Unexpected character '`'
のエラーが。
app/assets/javascripts/application.jsの中のjsで使っていた変数展開のバッククォートが問題だったらしいです。
<解決策>
config/environments/production.rbで
config.assets.js_compressor = :uglifier
ついでに、直接的には関係ないですが、以下でリフレッシュ(削除)できるらしいです。
rake assets:clobber RAILS_ENV=production
たれみみ(@taremimi_7)
【Rails】1個前のcontrollerとactionを取得する
1個前のcontrollerとactionを取得する。
url = Rails.application.routes.recognize_path(request.referrer)
previous_controller =url[:controller]
previous_action = url[:action]
たれみみ(@taremimi_7)
AWSでMysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)のエラー
1.mysql_config --socket で mysqlのソケット位置確認
2.confid/database.yml内で socket=**1の結果** を記述
3.mysql --help | grep my.cnf でmy.confの位置確認
4.でてきたファイルを1こずつ開いて、すでに中に何か書いてあるファイルの中に
[mysqld]
socket=**1の結果***
[client]
socket=**1の結果***
を記述。
5. sudo mysql.server reload MySQLを再起動
(参考:https://qiita.com/itooww/items/13055c8bb1d226ee5844)
(※ローカルマシンなら→ sudo mysql.server restartこれも有効かも )
以上
これでもわかんないことあったらツイッターでぼくに聞いてください!
たれみみ
@taremimi_7
Devise取り消す作業
メモ
Use the generator to remove configuration files as well (step 2), so the whole process would be (referencing previous answers):
- Remove the table:
rake db:rollback VERSION=<insert the version number of the migration>
- Remove the configuration:
rails destroy devise:install
- Remove your User model:
rails destroy devise User
(replace 'User' with the name of your model) - Remove references to devise in your routes.rb, gemfile, controller files, and view files like the following, if you used them (once again replacing 'user' with your model name):
- devise_for (routes.rb)
- gem 'devise' (gemfile)
- before_action :authenticate_user! (controllers)
- user_signed_in? (controllers, views)
- current_user (controllers, views)
- user_session (controllers, views)
confi/routes.rb の中のdevise関係削除する
引用元: Ruby: how to uninstall Devise? - Stack Overflow