Sometimes in a newly created server you can get this error when starting a ruby app:
`encode': "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError)
To fix simple export this variables or add to your ~/.bash_profile
export LANG=en_US.UTF-8
# Rails, PostgreSQL with Passenger + Nginx on Ubuntu 14.04 without RVM or rbenv | |
# https://www.brightbox.com/docs/ruby/ubuntu/ | |
# https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/ | |
# http://www.postgresql.org/download/linux/ubuntu/ | |
# https://github.com/rvm/rvm/blob/493b5bdcec50a2b521a6cad307334a3a4425099f/scripts/functions/requirements/ubuntu#L124 | |
$ ssh-copy-id root@SERVER -i ~/.ssh/id_rsa.pub | |
$ ssh root@SERVER | |
# apt-get update && apt-get upgrade |
Sometimes in a newly created server you can get this error when starting a ruby app:
`encode': "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError)
To fix simple export this variables or add to your ~/.bash_profile
export LANG=en_US.UTF-8
# Generate sitemap.xml in Rails app | |
This post shows how to make sitemap.xml for your web site. | |
The sitemap will be accessible by URL http://mysite.com/sitemap.xml | |
# Routes | |
```ruby | |
Myrails::Application.routes.draw do |
function historySupport() { | |
return !!(window.history && window.history.pushState !== undefined); | |
} | |
function pushPageState(state, title, href) { | |
if (historySupport()) { | |
history.pushState(state, title, href); | |
} | |
} |
# Use this setup block to configure all options available in SimpleForm. | |
# https://github.com/patricklindsay/simple_form-materialize/blob/master/lib/generators/simple_form/materialize/templates/config/initializers/simple_form_materialize.rb | |
# contribute here: https://github.com/mkhairi/materialize-sass/issues/16 | |
SimpleForm.setup do |config| | |
config.wrappers :default, class: :input, | |
hint_class: :field_with_hint, error_class: :field_with_errors do |b| | |
## Extensions enabled by default | |
# Any of these extensions can be disabled for a | |
# given input by passing: `f.input EXTENSION_NAME => false`. |