Rails generate error: No such file or directory - getcwd
The error is caused by an existing Rails Spring process running in the background.
You can easily solve this by running ps ax | grep spring
to find the process id and then kill it.
There's an issue on the Rails GitHub about this:
https://github.com/rails/spring/issues/247
No such file or directory - getcwd
Found out pg was installed instead of mysql2 in bundler.
No such file or directory - getcwd error on rubygems on Mac Os Lion
I had that same issue.... running sudo gem update --system
fixed the problem... give it a try.
Error: `class_eval': No such file or directory - getcwd (Errno::ENOENT)
Yes, I found the cause:
The reason was I had opened the webrick server in a tab rails server --debugger
Means If webrick server is already running , we can't run any command like scaffold
generate model
will not be working.
Thanks !
Sidekiq process on Elastic Beanstalk - Errno::ENOENT: No such file or directory - getcwd
As foreshadowed in both the question and some answers this was a rogue process that avoided termination, in this case due to a careless config change in one of our early deployments. Line 30 of our sidekiq.config controls the number of processes, and we dropped from 2 to 1 but did not manually remove the second process from the server after the change.
The moral of the story is that Sidekiq processes are not only vulnerable to unexpected behavior during deployments. Our errant process was happily completing jobs even without being stopped/started across multiple deployments, but anything that relied on Dir.pwd
and presumably any other script requiring ENV
data would fail days after a stable deployment if run on the persistent process.
If you see this type of failure, be absolutely positive you don't have unexpected processes running from prior deployments. This means ensuring they are properly terminated during deployment as @JeffD23 mentioned but ALSO ensuring you don't have something hanging around from deployments of yore.
env: ruby_noexec_wrapper: No such file or directory error
this same thing happened to me, i fixed it according to this comment: https://github.com/sstephenson/rbenv/issues/337#issuecomment-13235367
by running these commands
gem install rubygems-bundler
rubygems-bundler-uninstaller
gem uninstall rubygems-bundler
Related Topics
How to Connect to Browser Using Ruby Selenium Webdriver
Check If Array of Integers Increments in Ruby
Sidekiq Worker Not Getting Triggered
How Can One Set Property Values When Initializing an Object in Ruby
Commonmarker Gem Cannot Be Installed (Needed for Jekyll) MACos
How to Delete a Range of Values from an Array
How to Make Xcode Use the Correct Version of Ruby When Running a Script
How to Convert Activerecord Table Name to Model Class Name
How to Get a List of Gems That Are Installed That Have Native Extensions
Could Not Find Rake-10.0.4 in Any of the Sources (Bundler::Gemnotfound)
Ruby: Yield Block from a Block
Create a Human-Readable List with "And" Inserted Before the Last Element from a Ruby List
How to Add "Somewhere" a 'Before(:Each)' Hook So That All Spec File Can Run It
Best Practices in Ruby for Loop