[Umlaut-general] Rails 2.x code committed.

Jonathan Rochkind rochkind at jhu.edu
Tue Nov 25 16:16:26 EST 2008


Excellent!  It looks like on Rails2, unlike Rails1, "rake 
db:schema:load" gets you to exactly the same place as "rake 
db:migrate".  It does include versioning information in your db, so you 
will still be able to easily apply db changes in future versions when 
they come out. So I'll probably change my instructions on the wiki to 
use db:schema:load instead, since it seems more robust.

Clearly some bug I have in my migrations, but I don't know what, oh 
well, good enough for now!

Don't forget to run:

rake db:schema:load RAILS_ENV=production

to load the db schema in your production db too, if you want a seperate 
production and dev db.

Jonathan

Poulter, Dale wrote:
> That worked!  I'll still send account information since it may help the
> next person.  
>
> --Dale
>  
> ---------------------------------------
> Dale Poulter
> Automation Coordinator
> Library Information Technology Services
> Vanderbilt University
> Suite 700
> 110 21st Avenue South
> Nashville, TN  37240
> (615)343-5388
> (615)343-8834 (fax)
> (615)207-9705 (cell)
> dale.poulter at vanderbilt.edu
>
> -----Original Message-----
> From: umlaut-general-bounces at rubyforge.org
> [mailto:umlaut-general-bounces at rubyforge.org] On Behalf Of Jonathan
> Rochkind
> Sent: Tuesday, November 25, 2008 3:00 PM
> To: umlaut-general at rubyforge.org
> Subject: Re: [Umlaut-general] Rails 2.x code committed.
>
> Yeah, I still can't reproduce you're issue, but I'll scour the code 
> anyway looking for something that might have caused it.
>
> As a workaround, and another data point, instead of using 'migrate' to 
> create your database, you should be able to run (from Umlaut home 
> directory):
>
> rake db:schema:load
>
> That should get your db loaded too, but won't let you merge in new 
> changes in future db versions as easily. But try that, and see what that
>
> does, just for comparison.  For me, "rake db:schema:load" and "rake 
> db:migrate" both work fine.
>
> Jonathan
>
>
>
> Jonathan Rochkind wrote:
>   
>> Drat. It looks like I have:
>>
>> mysql  Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using 
>> readline 5.0
>>
>>
>> I will try again to reproduce your problem from a clean-slate 
>> database. And google around to see if anyone else has encountered
>>     
> this.
>   
>> I don't understand how that index name can already exist when running 
>> the migration on a clean-slate database. Seems like it must be a bug 
>> in my migration code, but I don't understand why I'm not able to 
>> duplicate it on my machine. I'll mess around on my machine and see if 
>> I can reproduce.
>>
>> Jonathan
>>
>> Poulter, Dale wrote:
>>     
>>> I am now getting the same error as before, any suggestions?  What
>>> version of mysql are you using?
>>>
>>> bash-3.00$ rake db:migrate (in /apps/umlaut)
>>> == 10 AddSomeMissingStuff: migrating
>>> ==========================================
>>> -- add_index(:service_types, :service_type_value_id)
>>> rake aborted!
>>> Mysql::Error: Duplicate key name
>>> 'index_service_types_on_service_type_value_id': CREATE  INDEX
>>> `index_service_types_on_service_type_value_id` ON `service_types`
>>> (`service_type_value_id`)
>>>
>>> (See full trace by running task with --trace)
>>>
>>>
>>>
>>>
>>> **************************
>>> Steps taken so far:
>>>
>>> - create home directory (/apps/umlaut)
>>>
>>> - cd /apps/umlaut
>>>
>>> - svn checkout http://umlaut.rubyforge.org/svn/trunk/ .
>>>
>>> - ./script/generate umlaut_local
>>>
>>> - mysqladmin -u root -p create umlaut_dev and umlaut_test, and umlaut
>>>
>>> - modified /config/umlaut_config/database.yml
>>>
>>> - rake db:migrate
>>>
>>>
>>>
>>>
>>> --Dale
>>>  
>>> ---------------------------------------
>>> Dale Poulter
>>> Automation Coordinator
>>> Library Information Technology Services
>>> Vanderbilt University
>>> Suite 700
>>> 110 21st Avenue South
>>> Nashville, TN  37240
>>> (615)343-5388
>>> (615)343-8834 (fax)
>>> (615)207-9705 (cell)
>>> dale.poulter at vanderbilt.edu
>>>
>>> -----Original Message-----
>>> From: umlaut-general-bounces at rubyforge.org
>>> [mailto:umlaut-general-bounces at rubyforge.org] On Behalf Of Jonathan
>>> Rochkind
>>> Sent: Tuesday, November 25, 2008 10:05 AM
>>> To: umlaut-general at rubyforge.org
>>> Subject: Re: [Umlaut-general] Rails 2.x code committed.
>>>
>>> Should be fixed. Just run "svn up" in your working directory, and try
>>>       
>
>   
>>> running "./script/generate umlaut_local" again, and proceed until the
>>>       
>
>   
>>> next problem, heh.
>>>
>>> Jonathan
>>>
>>> Poulter, Dale wrote:
>>>  
>>>       
>>>> Jonathan,
>>>>
>>>> Thanks for getting the new version out so quickly.  I have wiped out
>>>>     
>>>>         
>>> my
>>>  
>>>       
>>>> installation and started from scratch.  Here is what I have done so
>>>>     
>>>>         
>>> far
>>>  
>>>       
>>>> and the results --sadly an error.
>>>>
>>>> - gem install rails -v 2.1.1  (actually should be 2.1.2)
>>>> -cd /apps/umlaut
>>>> -svn checkout http://umlaut.rubyforge.org/svn/trunk/ .
>>>> - ./script/generate umlaut_local
>>>>
>>>>
>>>> bash-3.00# ./script/generate umlaut_local
>>>> No such file or directory -
>>>> /apps/umlaut/config/umlaut_config/initializers/umlaut
>>>>
>>>> --Dale
>>>>  
>>>> ---------------------------------------
>>>> Dale Poulter
>>>> Automation Coordinator
>>>> Library Information Technology Services
>>>> Vanderbilt University
>>>> Suite 700
>>>> 110 21st Avenue South
>>>> Nashville, TN  37240
>>>> (615)343-5388
>>>> (615)343-8834 (fax)
>>>> (615)207-9705 (cell)
>>>> dale.poulter at vanderbilt.edu
>>>>
>>>> -----Original Message-----
>>>> From: umlaut-general-bounces at rubyforge.org
>>>> [mailto:umlaut-general-bounces at rubyforge.org] On Behalf Of Jonathan
>>>> Rochkind
>>>> Sent: Monday, November 24, 2008 5:39 PM
>>>> To: umlaut-general at rubyforge.org
>>>> Subject: [Umlaut-general] Rails 2.x code committed.
>>>>
>>>> 'svn up' on an svn working copy will get you Umlaut code updated to
>>>>     
>>>>         
>>> work
>>>  
>>>       
>>>> with Rails 2. All wiki documentation has been updated appropriately,
>>>>     
>>>>         
>>> but
>>>  
>>>       
>>>> some changes to be aware of:
>>>>
>>>> 1. Now requires Rails 2.1.2. "sudo gem install rails -v 2.1.1".
>>>> 2. Generate local files with ./script/generate umlaut_local, not the
>>>>         
>
>   
>>>> rake task as previously. This will create somewhat different config 
>>>> files. If you haven't gotten very far with configging, I reccommend 
>>>> allowing the ./script/generate to overwrite all existing files, and 
>>>> start your local configuration from scratch. (./script/generate will
>>>>         
>
>   
>>>> prompt you whether to overwrite, or you can add a "--force" object
>>>>         
> so
>   
>>>>     
>>>>         
>>> it
>>>  
>>>       
>>>> will do so without prompting you).
>>>>
>>>> 3. Local configuration by and large no longer happens in 
>>>> config/umlaut_config/environment.rb, instead it happens in several
>>>>     
>>>>         
>>> files
>>>  
>>>       
>>>> in config/umlaut_config/initializers/umlaut.  See the wiki page for
>>>>     
>>>>         
>>> some
>>>  
>>>       
>>>> settings you want to set:
>>>>     
>>>>         
> http://wiki.code4lib.org/index.php/Umlaut_Setup#6._Review_additional_loc
>   
>>>  
>>>       
>>>> al_configuration
>>>>
>>>> 4. Updated the wiki page to say that a direct connection to the SFX
>>>>         
> db
>   
>>>>     
>>>>         
>>>  
>>>       
>>>> is really the _only_ way Umlaut is verified to work for 'search' 
>>>> functionality (A-Z list, manually entered journal title or
>>>>         
> citation).
>   
>>>>     
>>>>         
>>>  
>>>       
>>>> If this isn't available to you, though, talk to me, and other things
>>>>     
>>>>         
>>> are
>>>  
>>>       
>>>> theoretically possible, just not currently verified to work.
>>>>
>>>> 5. When you get to deployment, there is now a 'wizard' (actually a
>>>>     
>>>>         
>>> Rails
>>>  
>>>       
>>>> generator) to create some of the neccesary deploy config files for
>>>>     
>>>>         
>>> you.  
>>>       
>>>> This is good, as this is a confusing and error prone process
>>>>     
>>>>         
>>> otherwise.  
>>>       
>>>> (I needed it myself!). Documented on wiki under deployment.
>>>>
>>>>       
>>>>         
>>>   
>>>       
>
>   

-- 
Jonathan Rochkind
Digital Services Software Engineer
The Sheridan Libraries
Johns Hopkins University
410.516.8886 
rochkind (at) jhu.edu


More information about the Umlaut-general mailing list