Rails 6.0.3.2 on Termux
pkg upgrade
pkg install ruby vim git nodejs
nokogiri will build natively and would need the ff packages and will need pkg-config to find them:
- libxml-2
- libxslt
- libexslt
so install pkg-config
pkg install pkg-config
libxml-2 (2.9.10-3) is installed when you run:
pkg install build-essentials
pkg install libxslt
pkg install libexslt will not work, I guess it's already bundled with libxslt
tried running:
gem install nokogiri -- --use-system-libraries
nokogiri was successfully installed
finally install rails without docs, we dont want them taking up space:
gem install rails --no-doc
libsqlite for sqlite3 gem
pkg install libsqlite
install yarn first before running rails new:
pkg install yarn
ffi and rb-inotify are already included via bundle when you run:
rails new
gem install tzinfo-data
tzinfo-data issue when running rails server:
rubygems/rubygems#3212
try removing the Gemfile.lock and running the bundle install again.
or
Running bundle update tzinfo
What worked for me is changing tzinfo-data gem in Gemfile from:
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
to
gem 'tzinfo-data'
then deleting Gemfile.lock and running bundle install again
now run the server via rails server
and browse localhost:3000
on any browser on your device.
All is well until we create our first controller and change the routes root path:
rails generate controller Dashboard index
and on config/routes.rb file:
root to: 'dashboard#index'
then browsing again to our browser on localhost:3000
gives us this ActionVew::TemplateError:
Webpacker can't find application in <my app path>/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment
unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:
{
}
tried running compilation on test environment:
RAILS_ENV=test NODE_ENV=test bundle exec rails webpacker:compile
this returns Errno::EACCES: Permission denied @ rb_sysopen
I haven't found a solution to this issue at the time of this writing.