Looks like writebook is free, so I “purchased” a copy. At the bottom of the email I received it said I could download a zip, which I did.
Unpacking that zip into an empty directory, I found a Rails application that won’t work with Rails 8, or any Ruby version released on or after February 14th. So I brute forced it.
I first removed the Dockerfile and Gemfile.lock. I updated .ruby_version to 3.4.2. I commented out the following line in config/environments/production.rb:
bundle add dockerfile-rails --optimistic --group development
bin/rails generate dockerfile
I modified bin/dockerfile-entrypoint so that the line immediately above the db:prepare line reads:
if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
I ran fly launch and accepted the defaults. It warned about configuration being used during build. I ignored that warning and proceeded with fly deploy.
After you set up your username and password the app will redirect you to a screen that will show an error. Just refresh the page and access with the credentials you just set up
If you been following the tutorial from rubys, the mod that very kindly help me solve this thread, you will get to a point where he mentions something about db:prepare. This line isnt originally on the application, it only appears after successfully ran bin/rails generate dockerfile
The mod put two commands together 1) bundle add dockerfile-rails --optimistic --group development (you may have to run this line with the sudo prefix) 2) bin/rails generate dockerfile
The zip where rubys and me got the code from comes from the you received after purchase the free license. Its on the very last line P.P.S. Eager to see how we built Writebook? You can also download a zipfile with the complete source code.
First time with ruby?
If is your first time with rails, it was for me - installing rails is not easy, its a pain. Seriously you will get SO MANY times an error because of some file is ‘unauthorized’ - you installed ruby improperly.
I suggest watch a tutorial just to install the thing beforehand and dont neglect rbenv.
Here is the gemfile that worked for me. Hope it eases the process:
Seems like the no content can be stored. Past the front page the app cant store text, images, or sections.
Went through the docs and the logs of the application.
Apparently there was this problem every time a user tried any type of text:
Trying to resolve this issue, I set up a new redis instance in fly (dashboard > upstash redis > new, then you click on the application and read the upstash dashboard to find the redis url) with the connection string redis://default:9XXXX@fly-writebook-test3-redis.upstash.io:6379. Then I looked at any mention of redis (like redis config) and went through the files of the application.
Added Redis Intializer
Added the following file into config > initializers > redis.rb
# config/initializers/redis.rb
require "redis"
redis_url = ENV.fetch("REDIS_URL") { "redis://localhost:6379" }
REDIS = Redis.new(url: redis_url)
# Configure Resque to use this Redis connection
Resque.redis = REDIS if defined?(Resque)