`<module:RailsSettings>': uninitialized constant ActiveSupport::CurrentAttributes when running rails server - ruby-on-rails

I have a ROR application I'm trying to stand up locally on a windows machine. Since it requires passenger I am using WSL2 to run Ubuntu. I've installed ruby (2.6.5) and made sure rails in installed (4.2.11.3). I've run bundle install successfully, but every time I try to run a command such as rails server, rake, ect. I get an error saying uninitialized constant ActiveSupport::CurrentAttributes. From googling, there isn't really one answer for this. I've tried removing and re-installing rails. Removed railties as well, but the error keeps happening. My suspicion is that it has something to do with me running on WSL2, but I am not sure.

Related

Error sending emails in Ruby 2.6.2 / Rails 6.1.4 on Centos 8 in production mode

I have a rather strange problem. I have an app mounted on rails by "rvm use 2.6.2#rails6.1.4". Apparently everything works correctly in production environment, except for sending emails. The strange thing is that from development mode it works correctly, but in production mode it returns the following error:
NameError (uninitialized constant Mail::TestMailer)
I have already tried completely reinstalling all the gems including the rvm. The problem persists the same.
The web app runs on top of Apache/Phusion Passenger on Centos 8 Stream.
Please, I need guidance on it, since I am totally stuck with my project.
Completely reinstall gems, update gems to latest versions, disable firewall, disable SELinux

Why does Elastic Beanstalk keep asking me to change from a root user for Bundler in a Rails app after I've changed it?

I'm trying to deploy a Ruby on Rails app online using Elastic Beanstalk from AWS as part of a project. I'm using the AWS and EB CLI and I can run eb init without a problem. However, when I try to run eb create myproject-env it leads to this warning:
{DATE} ERROR [Instance: myInstance] Command failed on instance. Return code: 20 Output: (TRUNCATED)...dor/cache ']'
+ bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
You must use Bundler 2 or greater with this lockfile.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
I've tried googling the problem and I keep being lead back to this link, which makes sense as far as I can tell. The thing is, I can't figure out how to get past this error. I've tried making new IAM users and using --profile myProfile, I've changed the user in Command Prompt, and I've uninstalled and reinstalled Bundler, awscli, and awsebcli. I'd like to keep this in the CLI just because I want to be able to use eb deploy in the future. And I can run the app locally using Puma with no problem, so I feel like I just haven't configured something correctly with AWS.
I also can't figure out the error about using a version of Bundler 2 or higher, because I am using a higher version on my computer right now.
I'm using Rails 5.2.2, Ruby 2.4.4, and Bundler 2.0.1 and I'm using Windows Command Prompt.
Any help would be appreciated!

Can't boot WEBrick, the folder for Rails gem is empty

I'm following Michael Hartl's Ruby on Rails tutorial, and I got stuck at trying to start rails server on my Windows 7 machine.
I'm trying to do this by following instructions in Chapter 1.2.5., i.e. by typing
rails server
However, instead of booting WEBrick, this returns the instructions for usage of 'rails' command. I've been googling this for a while, and some of the answers seem to have implied that something is wrong with the rails gem.
Now, I've found the rails gem folder ("C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\rails-3.2.3"), and it's empty!
Also when I try
rails -v
it returns "Rails 3.2.16", although I've removed this version of the gem; if I try
gem list
it kept telling me that the version is 3.2.3.
This persisted until I deleted railties version 3.2.16, which resulted in
rails -v
returning 'Rails 3.2.3', but I still can't boot WEBrick.
Any help would be appreciated.
Did you run the installer?
At the time of this writing, I recommend using the Ruby 2.0.0-p353.
http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct
Save yourself some future gem headaches and install the DevKit too.
http://rubyinstaller.org/downloads/
It should create a folder at C:\Ruby200. Start a new command prompt for the new paths to take affect.
Once Ruby is install, gem install Rails. From your other post, I recommend gem install rails -v 3.2.16
Then execute rails new project_name, then cd project_name. Then run rake db:migrate to create the initial database. At this point, you should be able to run rails server and visit localhost:3000 in your browser.
OK, I've managed to solve my problem.
I've seen a few more people having the same issue, but none of the solutions that I've found helped me, so here's what did it for me, though I'm not 100% sure what exactly was that one thing that actually did it...
I've followed the advice #scarver2 gave in response to my other question, and uninstalled both Rails and Railties gems from my crispy fresh installation of Ruby 1.9.3. (I've installed it using RailsInstaller). Then I've installed Rails 3.2.16 gem by typing
gem install rails -v 3.2.16
and this also installed the corresponding Railties 3.2.16 gem without my intervention.
Then I followed steps from chapters 1.2.3. and 1.2.5. of the tutorial, but making sure that line referencing ruby version in my Gemfile actually corresponds to the version of Ruby that I have installed.
I typed
ruby -v
in the console, to make sure that I have version 1.9.3. indeed. Confirming this, I've edited the Gemfile in my app so it says
ruby '1.9.3'
instead of ruby '2.0.0' line that's used in Listing 1.5. of the tutorial.
After that I've simply went to my app folder, and typed
bundle update
bundle install
in the console, and this time it did not return any errors as it did in my previous attempts. After that, typing
rails server
did what it should have, and my WEBrick server booted, allowing me to access my app on localhost. Yay!
Now, what I think may have gone wrong the last time was either me screwing up the Gemfile, so the gem versions and their dependencies got messed up. I also assume that ineptly trying to fix this by installing and uninstalling different versions of various gems did not quite help. What may have helped was uninstalling Rails and Railties gems, and installing Rails gem again.

uninitialized constant Heroku::VERSION (NameError)

Seemingly out of the blue, I am no longer able to run "rails server" or "rails console" on this project due to the above error message. I'm rather certain I ran a "gem update heroku" on this project's RVM gemset a few days ago, so that may be the root cause. Ruby is ruby-1.9.2-p136. Rails is Rails 3.0.9. Once I get to the bottom of this error, I plan on upgrading to the latest Rails 3.0 release (3.0.14), but need to resolve this issue first. Any ideas? I tried installing the Heroku toolbet to no avail.
The Heroku gem seems to be fine in all other ways, I am able to run "heroku login", "heroku rake", "heroku console", etc, just fine. The issue is only on my dev machine and only when I attempt to start up the server or run console. Next step is to clone this project on my new MacBook and move forward that way...
Upgrading to the latest minor versions of Ruby (1.9.2) and Rails (3.0.14) resolved the issues. Thanks for all your help.

Error while starting sproutcore server uninitialized constant SproutCore::Rack::Proxy

Issued sc-server command from the app and i got the above error. Using fixures in my program.
seems like you Sproutcore install is messed up. Are you using the latest version of Ruby, and are the Gems all updated?

Resources