Displaying 18 results from an estimated 18 matches for "autoload_path".
Did you mean:
autoload_paths
2006 Aug 10
6
Migrations suddenly broken: undefined method autoload_paths
I really need some help here because I am at a loss. I have been using
migrations just fine now for a while and I suddenly started getting a
very bizarre error when migrations are run:
undefined method `autoload_paths='' for Dependencies:Module
I have tried rolling back my application code, and rolling back the
rails edge revision I am running but neither seem to help.
I have installed the latest rails gems, even though I am running edge.
I have even restarted our server. I just have no idea what t...
2012 Jun 07
3
Couldn't reload a module when it's changed. Tried :require_dependency, :watchable_dirs, :unloadable
I''m completely messed with module reloading in development mode. I have
to restart app server each time I edit lib/z/nginx.rb which is included
in app/models/user_case.rb
app/models/user_case.rb
require_dependency ''z/nginx''
class UserCase < ActiveRecord::Base
include Z::Nginx
unloadable
I added to environment.rb
2012 Jul 12
1
engines: accessing classes from the hosting-apps lib
...thout
any troubles.
But when I try to access classes that are defined in the lib-directory of
the hosting app, they are not found and I get a
uninitialized constant Redmine
where Redmine is a module defined in the lib-directory of the hosting app.
The lib-directory has added this dir to the autoload_paths, but the engine
does not see them. The documentation
(http://api.rubyonrails.org/classes/Rails/Engine.html) here is a litte
vague:
The Application class adds a couple more paths to this set. And as in your
Application, all folders under app are automatically added to the load
path. If you h...
2011 Feb 04
6
A plugin inside an engine
In Rails 3, is it possible to have a plugin inside an engine?
Adding the lib dir of the plugin to autoload_paths doesn''t seem to
work.
I can manage to load it by adding that path to $: and requiring the
init.rb file, but I''m not sure that''s the correct approach.
Thanks!
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core"...
2012 Apr 07
3
Is require_dependency supposed to be a public API?
If so, shouldn''t it be documented in the Rails API?
Or is there a better way to allow class reloading of my files under lib.
I mean, I know about config.autoload_paths, but I want to be explicit
about my requires. I just want to be able to reload then on each request
when I''m working on them.
require_dependency seems to do just that but I''m worried since it is not
mentioned in the official public API.
--
You received this message because...
2010 Jul 27
4
Ruby on Rails 3 RC and files in "lib" directory
In Rails 3b4 my ruby files in the lib directory of my application were
automaticaly loaded/required.
In Rails 3rc1, there are not anymore. Is this normal?
Where is the commit that changed this?
What is the best prefered way to load the files in "lib"?
Thanks for your answers.
Nicolas.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed
2012 Oct 21
1
load_missing_constant
I have a model ''site'' defined in a sub-folder ''cms''
class Cms::Site < ActiveRecord::Base
.....
the model is loaded correctly , checked in console:
application.rb
config.autoload_paths += Dir["#{config.root}/app/models/**/"]
console
>Cms::Site.all => []
Now trying to access this model from a sites_controller ( in
backoffice/cms subfolder, action: index ) I get the
load_missing_constant error, aslking for the model to define Site and
not Cms::Site... where am...
2012 Mar 26
1
Models in sub-folders in Rails 3
...lders, but are name spaced (views also
in a corresponding sub_folder).
app/controllers/sub_folder/posts_controller.rb
class SubFolder::PostsController < ApplicationController
end
This works fine, but I want to move on to Rails 3, and it all falls
apart...
In application.rb I have
config.autoload_paths += Dir["#{config.root}/app/models/**/"]
So Rails should be able to find the models. However running tests (which
are subfoldered in an analogous way), I get
LoadError: Expected R:/test3/app/models/sub_folder/post.rb to define
SubFolder::Post
So okay, suppose I name-space my models? No...
2012 Nov 06
1
Understanding the Rails /lib/ Directory
...index_helper.rb file:
module IndexHelper
require ''HelloWorld''
end
Also, I include the following code on the view index.html.erb:
<%= @howdy %>
I''ve read where I need to include the following line in the /config/
application.rb file:
config.autoload_paths += %W(#{config.root}/lib
However, my preference is to load this module only when the View
renders the page, not when the Application loads. What am I missing?
Thank you
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post t...
2012 Oct 24
0
Announce: Puppet Dashboard 1.2.13-rc1 Available
...rocess has ended, as INT is
responded to
immediately by webrick.
(#9296) Fix loading rack for rubygems >= 1.8
Rubygems version 1.8 broke some of the ways vendored gems used to
work in Rails
2. This commit updates the config/environment.rb to add all of the
gem libs to
the rails autoload_paths. It also updates the actionpack action_controller
library to not call out to gem explicitly. We know that the correct rack
version is being supplied in the vendored gems, so the following
require ''rack''
line will succeed.
This also munges the load path in config/...
2012 Nov 05
3
Announce: Puppet Dashboard 1.2.13 Available
...rocess has ended, as INT is
responded to
immediately by webrick.
(#9296) Fix loading rack for rubygems >= 1.8
Rubygems version 1.8 broke some of the ways vendored gems used to
work in Rails
2. This commit updates the config/environment.rb to add all of the
gem libs to
the rails autoload_paths. It also updates the actionpack action_controller
library to not call out to gem explicitly. We know that the correct rack
version is being supplied in the vendored gems, so the following
require ''rack''
line will succeed.
This also munges the load path in config/...
2012 Jun 08
1
Rspec include paths
''m using rspec 2.10 with Rails 3.2.1 and have problems with classes not
being found.
I have put a class called DbTasks under a dir app/util. Under spec, i''ve
created file util/db_tasks_spec.rb which runs afer i included the line:
require File.join(File.dirname(FILE), ''../../app/util/db_tasks'')
However, rspec now isn''t able to find my models. I
2012 Oct 25
0
[Rails 3.2.8] ActiveSupport::BufferedLogger extension, undefined_method
I tried to extend it , with this class , loaded at config time :
config.autoload_paths += Dir["#{config.root}/lib",
"#{config.root}/lib/**/", "#{config.root}/app/inputs"]
lib/extension.rb
class ActiveSupport::BufferedLogger
def detailed_error(e)
error(e.message)
e.backtrace.each{|line| error line }
end
end
but calling it in my controller...
2010 Aug 17
6
Overly aggressive constant unloading of Rails 3.0
In Rails 3.0 (both RC and edge), any constant that''s defined while loading a
file in development mode will get unloaded on each request, regardless of
whether it comes from an autoload path in the application or from external
code such as a gem.
Example file (tested on a fresh edge app):
# kittens.rb
require ''nibbler/json'' # "nibbler" is a gem specified
2010 Sep 30
3
Plugins Not Loading
Hi.
I''m running Rails 3.0 on Mac OS X, and I''m trying to get the
acts_as_list, other plugins, as well as libraries running. From what
I understand, rails should be loading those automatically once placed
in the proper directories. However, that is not happening in my case,
and I''m getting errors such as "undefined method `acts_as_list'' for
2010 Nov 05
4
Inheritance alternative
I have to objects with common functionalities and a lot of difference.
So I want that each have his own table but inherit the common
functionalities from a parent class. How can I do this in Rails ?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2014 Jun 11
0
my webpage does not send emails confimation/notification
...nfig/environments/* take precedence over those
specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be
autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is
alphabetical).
# :all can be used as a placeholder for all plugins not explicitly
named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers tha...
2012 Jan 23
0
Problem loading modules through ActiveSupport on_load
...:extend, ClassMethods
end
module ClassMethods
def has_history(options = {})
send :include, InstanceMethods
end
end
module InstanceMethods
# methods ...
end
end
end
**# config/application.rb**
config.autoload_paths += %W(#{config.root}/lib)
**# config/environment.rb**
ActiveSupport.on_load(:active_record) do
include History::Model
end
This works, the methods are mixed into the models.
In a similar way, I wanted to package another set of methods with a
different purpose in the same applicati...