I''ve just done a quick non-gems install of 0.8.0, running over ruby-1.8.2 (2004-07-29). Unfortunately, I can''t seem to create a new controller. The first issue was that it seems that this version requires you have all of the database drivers (MySQL, PostgreSQL and SQLite) installed. In vendor/activerecord/lib/active_record.rb: require ''active_record/connection_adapters/mysql_adapter'' require ''active_record/connection_adapters/postgresql_adapter'' require ''active_record/connection_adapters/sqlite_adapter'' The sqlite adapter attempts to use gems to grab the sqlite library it needs if it can''t require it in the normal way (an issue that has been mentioned before on this list, though I couldn''t find a resolution for it), which I solved for the moment by commenting out that last line. (I have PostgreSQL and MySQL drivers installed.) For developers: just remember, there are people out there with very good reasons not to use gems. For my application I build my open apache, mod_ruby, all non-standard ruby libs, and many other things because I need to run on machines with all sorts of random stuff installed that I can''t control. Anyway, after that: dev1 $ ./script/new_controller ./script/../config/environments/../../vendor/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:66:in `establish_connection'': ActiveRecord::AdapterNotFound (ActiveRecord::AdapterNotFound) from ./script/../config/environments/production.rb:6 from ./script/new_controller:3:in `require'' from ./script/new_controller:3 The adapter_method is "postgresql_connection", which seems right since I set the config/database.yml to use postgresql. self of course is ActiveRecord::Base, which doesn''t have this method. What''s gone wrong? cjs -- Curt Sampson <cjs-gHs2Wiolu3leoWH0uzbU5w@public.gmane.org> +81 90 7737 2974 http://www.NetBSD.org Make up enjoying your city life...produced by BIC CAMERA
Curt Sampson wrote:> The adapter_method is "postgresql_connection", which seems right since > I set the config/database.yml to use postgresql. self of course is > ActiveRecord::Base, which doesn''t have this method. What''s gone wrong?The PostgreSQL and SQLite adapters require their respective Ruby bindings. The MySQL adapter works out-of-the-box since pure-Ruby bindings are included. RubyGems are not required, though the AR 1.0.0 SQLite adapter had an errant dependency that has been fixed in CVS (and the beta gems.) Best, jeremy
Curt Sampson wrote:>dev1 $ ./script/new_controller >./script/../config/environments/../../vendor/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:66:in `establish_connection'': ActiveRecord::AdapterNotFound (ActiveRecord::AdapterNotFound) > >The only possible reason for this error is that it cannot do require ''postgresql''. In CVS HEAD this behavior has been changed - it would explicitly raise the LoadError. Alex
On Thu, 11 Nov 2004, Alexey Verkhovsky wrote:> >dev1 $ ./script/new_controller > >./script/../config/environments/../../vendor/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:66:in `establish_connection'': ActiveRecord::AdapterNotFound (ActiveRecord::AdapterNotFound) > > > > > The only possible reason for this error is that it cannot do require > ''postgresql''.That was it; I made a typo when setting up an element in $:. It''s nice to know that new versions will give a better error message. How about dealing with not using SQLite when not using gems? (Although from the looks of it, even with gems you can''t use rails without SQLite installed.) cjs -- Curt Sampson <cjs-gHs2Wiolu3leoWH0uzbU5w@public.gmane.org> +81 90 7737 2974 http://www.NetBSD.org Make up enjoying your city life...produced by BIC CAMERA
On Fri, 12 Nov 2004, Curt Sampson wrote:> > The only possible reason for this error is that it cannot do require > > ''postgresql''. > > That was it; I made a typo when setting up an element in $:. It''s nice > to know that new versions will give a better error message.Oh, the other question is, of course, what is the canonical way to make sure that my local stuff gets included? I just added $:.unshift("/path/to/my/stuff") to config/environments/shared.rb; do folks have other suggestions? cjs -- Curt Sampson <cjs-gHs2Wiolu3leoWH0uzbU5w@public.gmane.org> +81 90 7737 2974 http://www.NetBSD.org Make up enjoying your city life...produced by BIC CAMERA
Curt Sampson wrote:>Oh, the other question is, of course, what is the canonical way to make sure >that my local stuff gets included? I just added > > $:.unshift("/path/to/my/stuff") > >to config/environments/shared.rb; do folks have other suggestions? > >Either that (you do it in config/environments/shared.rb and it is more readable is you add it to the ADDITIONAL_LOAD_PATHS array), or put your stuff to ./lib directory. I don''t know about the version you are using, but CVS HEAD doesn''t force you to have SQLite installed. Alex
On Fri, 12 Nov 2004, Alexey Verkhovsky wrote:> Curt Sampson wrote: > > >Oh, the other question is, of course, what is the canonical way to make sure > >that my local stuff gets included? I just added > > > > $:.unshift("/path/to/my/stuff") > > > >to config/environments/shared.rb; do folks have other suggestions? > > Either that (you do it in config/environments/shared.rb and it is more > readable is you add it to the ADDITIONAL_LOAD_PATHS array)...In this case this particular web server is part of a much larger project, and the /path/to/my/stuff is not underneath the rails directory, so I cannot use ADDITIONAL_LOAD_PATHS. (It appears that everything in ADDITIONAL_LOAD_PATHS must be relative to the rails directory.)> I don''t know about the version you are using, but CVS HEAD doesn''t force > you to have SQLite installed.I am using the 0.8.0 release, which apparently has some bugs that have been fixed in head. cjs -- Curt Sampson <cjs-gHs2Wiolu3leoWH0uzbU5w@public.gmane.org> +81 90 7737 2974 http://www.NetBSD.org Make up enjoying your city life...produced by BIC CAMERA