I'm using rails 6.0.3.4, ruby 2.5.0 with nginx/1.18.0 (Ubuntu). Everything was fine until I did a new deploy (using capistrano) and suddenly I'm getting Could not spawn process for application /home/deploy/appname/current: The application encountered the following error: uninitialized constant URI::Generic (NameError).
I have required these in application.rb (also tested requiring in the model) with no luck:
require 'uri'
require "uri/generic"
At this point, I'm not sure what could be wrong.
Thanks in advance if anyone has any suggestions.
It seemed it was a bug between Rails and Ruby, so I upgraded my Rails to the current stable version as well as upgraded my ruby version.
Related
Environment
Ruby [1.9.3p547]
Rails [3.2.22.5]
Devise [3.0.4]
When i run any rails or rake command for this application it is giving me below error
/config/initializers/devise.rb:3:in <top (required)>': undefined
methodsetup' for Devise:Module (NoMethodError)
If i comment file devise.rb and run rails command again.
/config/initializers/doorkeeper.rb:1:in `':
uninitialized constant Doorkeeper (NameError)
And so on if i comment doorkeeper.rb file it is giving me error for
/config/initializers/kaminari_config.rb:1:in `':
uninitialized constant Kaminari (NameError)
i can't get what is issue with my application i am unable to perform any rake or rails. its directly giving me error of uninitialized constant .
The ruby and rails version is very old. I don't want to upgrade it. Earlier i though it was issue of devise gem. but it must not be issue of devise gem.
Please help me if any one has idea about this type of error.
Thanks in advance
I think you have some installation issues. Please try to install from scratch.
Follow these steps.
Find version of bundler from Gemfile.lock
Install bundler with that version and continue with bundle install
Check for API_KEY and values in your initializers.
Check for Gem support for your Ruby version (as it is too old)
I try to create a standalone migration file by executing the following command:
rails generate migration LoadData
But I got the following error:
PATH-TO/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)
PATH-TO/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
...
I am using Rails v2.3 and ruby Enterprise edition. Why I got this error, how to get rid of it?
This is an incompatibility between some version of Rails 2.3.xx and recent versions of RubyGems. I got this error with Rails 2.3.4 and then used a more recent version of Rails 2.3.11 as of now to get rid of this error.
In case it is not possible to update the Rails version, then in your RakeFile add in the beginning.
require "thread"
Downgrading the RubyGems version will also help. Afaik Rubygems version 1.3.5 is compatible with Rails 2.3.4 and 2.3.5.
Hope this helps.
I have a Rails app I am trying to test in Jruby on Engineyard. I can get it locally working when i switch ruby version in rvm to 1.9.2 (jruby) However when on engineyard a deploy fails:
syntax error, unexpected ':'
I solved this error locally using 1.9.2 export JRUBY_OPTS=--1.9 I have tried this on engineayrd but i am still getting the same error.
Does anyone know how to set EngineYard to default to 1.9.2 not ruby-1.8.7-p330?
Any help is greatly appreciate
Try putting the following in /home/deploy/.jrubyrc:
compat.version=1.9
I'm following the Getting Started with Rails guide but ran into an issue opening http://localhost:3000
Shell output:
[2010-03-23 19:19:14] ERROR NameError: uninitialized constant ActiveResource::Base
Error in the browser:
Internal Server Error
uninitialized constant ActiveResource::Base
WEBrick/1.3.1 (Ruby/1.8.7/2009-06-12) at localhost:3000
I followed the directions exactly as they were specified in the guide:
Ran rails generate controller home index
I removed index.html
Added root :to => "home#index" to config/routes.rb
I checked app/views/home/index.html.erb and it is indeed there.
I then used rails server to launch the server. At first attempt the browser loads a blank page, but afterwards starts showing the browser error above.
Why is it that Rails can't locate the index.html.erb file? Or is the error something different?
-
Running Rails 3.0beta with Ruby 1.8.7
uninitialized
constant ActiveResource::Base
It looks like there's a problem with your Ruby/Rails setup.
Do you have more than one version of Ruby on your system? It could be that the version of Ruby you're using to run your app is looking for the Rails gems (ActiveResource::Base) in the wrong repository.
If you're using the Getting Started guide I recommend that you don't use Rails 3.0 beta, as, well, it's a beta release. It's best to use the stable-of-the-moment 2.3.5.
I have this error as well. I am running Ruby 1.8.7 p249 under RVM - Rails 3 beta3 on Ubuntu (Lucid Lynx). The strange thing is I have the exact same setup (RVM, Ruby version & gems) on my Mac and it works fine.
UPDATE: I tried again using RVM to switch to Ruby-1.9.2-HEAD and everything is working as expected. Still doesn't solve problem but it get Rails 3 working at least.
I just installed the Rack-Bug and created the middleware file that it needs in the config folder. But I am unable to start my server.
Im using Rails 2.3.4 with Ruby 1.8.7.
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant IPAddr (NameError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in const_missing'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:92:inconst_missing'
from /home/xxxxx/xxxx/trunk/config/initializers/middleware.rb:6
I can't figure out what I am doing wrong. Any help would be great.
I had the same problem.
The solution is to put the following line at the top of your environment.rb (requirement of a ruby core class: http://ruby-doc.org/core/classes/IPAddr.html):
require 'ipaddr'