I just created a new Rails 6 app. Everything went fine until I tried to launch the local server with rails s, and got this error message :
RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment
Exiting
and
Webpacker configuration file not found /Users/remy/dev/voter/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory # rb_sysopen - /Users/remy/dev/voter/config/webpacker.yml (RuntimeError)
But when I run rails webpacker:install I still have the error.
That error usually hints at an unmet Yarn dependency. Try installing or updating Yarn before running rails webpacker:install.
Here are the Yarn Docs for quick reference just in case.
Related
My rails development environment runs in Docker, and I cannot start the rails console without disabling spring using DISABLE_SPRING=true. The snipper below illustrates what happens:
app#docker:[project] $ bundle exec rails c
Could not find rake-13.0.6 in any of the sources
Run `bundle install` to install missing gems.
app#docker:[project] $ DISABLE_SPRING=true bundle exec rails c
D, [2022-01-19T03:44:17.663136 #20] DEBUG -- sentry: initialized a background worker with 6 threads
Loading development environment (Rails 6.1.4.4)
irb(main):001:0>
I've tried rebuilding my docker image from scratch, deleting the Gemfile.lock and building again. Nothing works, except for disabling spring.
Surprisingly, rails server works fine.
Any ideas?
I have an image asset in app/assets/images which I am trying to compile before deploying in production as per asset pipeline guide.
Upon trying to execute:
RAILS_ENV=production rails assets:precompile
I get the following error:
rails aborted!
Errno::ENOENT: No such file or directory - C:/../bin/yarn --version
Tasks: TOP => assets:precompile => yarn:install
(See full trace by running task with --trace)
The above error also happens when I run
rails yarn:install
Checking yarn version
$ yarn
yarn install v1.22.5
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.80s.
I have installed webpacker 5.2. I tried to check the bin/yarn file but did not find any problem. Any ideas?
I have similar problem, and this deals because using rails 6.1 that has this issue, they have pushed merge to branch, but if you still has problem
temporary solution that I did
create one file /bin/yarn
if you using linux just put content as below
#!/bin/bash
exit 0
and make sure it executable, by running chmod 755 /bin/yarn
now you can run precompile command
I'm trying to deploy an API-only Rails 5 application to AppEngine Flex w/ the standard Ruby runtime, and I'm getting the following error at the very end:
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
/usr/bin/env: 'ruby2.5': No such file or directory
I'm specifying ruby '2.5.1' in my Gemfile and I've added an explicit .ruby-version file to the root of my project set to 2.5.1 as well.
I have no other debugging information available to me in the logs, no other fancieness. My entrypoint command is:
bundle exec rails server Puma -p $PORT
I can provide more details if needed, not sure what else might be relevant. Any pointers? As far as I can tell, nothing on my side is asking for a version of ruby that specifically at execution time.
Thanks!
EDIT: Here's my app.yaml file
entrypoint: bundle exec rails server Puma -p $PORT
env: flex
runtime: ruby
UPDATE:
I can verify that I'm having similar problems when trying to exec rake tasks like db:migrate:
--------- EXECUTE COMMAND ----------
bundle exec rake db:migrate
/usr/bin/env: 'ruby2.5': No such file or directory
ERROR
ERROR: build step 0 "gcr.io/google-appengine/exec-wrapper:latest" failed: exit status 127
--------------------------------------------------------------------------------------------------------------------------------------------------------
OK I now see what has happened after debugging the docker image locally. Because I was on ubuntu and had used system ruby to install gems it had embedded /usr/bin/env ruby2.5 into every executable script that was bundled into my app. I deleted all gems and switched to rbenv for managing Ruby version which mitigated this odd behavior between unbuntu's ruby and my app.
Rails C and Rails S not working when in the correct directory.
have tried:
$ bundle exec rake rails:update:bin
this returns the following error:
bundler: command not found: rails:update:bin
Install missing gem executables with `bundle install`
I have ran:
Bundle Install
this still returns the same error
Have changed directories (higher and lower), repeated steps and attempted commends for same result.
I was running rails server, when i stopped the server and tried to restart server, the error appeared, so I'm thinking this has something to do with a physical location change (potentially the bin file), which is consistent as when I try and run a bin/rails command, i'm receiving an error of:
bundler: command not found: rails:update:bin
Install missing gem executables with `bundle install`
I have tried to rake the bin folder as below:
rake rails:update:bin
however I am receiving this error:
rake aborted!
Don't know how to build task 'rails:update:bin' (see --tasks)
Finally, I have checked the physical location and there is a .bin file, however this folder is empty and it's not in a .gitignore directory.
Ancillary information
Rails version: 5.1.4
ruby version: 2.3.4
Server: heroku
OS. Ubuntu 16.04 (via virtualbox).
I have not upgraded rails, this is a fresh install
I am at a loss.
rails update:bin or rake update:bin These are the right ways that execute a rake task.
Just FYI, this is the first time I'm deploying something on a production server. I went through this guide as my server is also hosted on DO.
The environment is pretty much the same - I'm using Ubuntu 14.04, Ruby 2.3.3 (rbenv) and rails 5.
I followed everything step by step and I have gotten no error, however, now I'm getting a 502 bad gateway when accessing my public IP.
I have noticed that for some reason after starting puma manager (sudo start puma-manager), the directory "shared/sockets/puma.sock" is not getting created.
When I start puma manually by using -> RACK_ENV=production bundle exec puma -C config/puma.rb from my app directory, I get the following error:
bundler: failed to load command: puma (/root/.rbenv/versions/2.3.3/bin/puma)
Errno::ENOENT: No such file or directory - connect(2) for /root/belooga/shared/sockets/puma.sock
Any idea of what I might be doing wrong? Should you need to see any file, please let me know and I'll provide anything that might be needed.
Cheers!
EDIT:
I have double-checked all the paths in:
myapp/config/puma.rb
/etc/puma.conf
/etc/nginx/sites-available/default
... the directory "shared/sockets/puma.sock" is not getting created.
Here is your problem, create the directory before you start the puma server.