Talk:Installation

From mx Help Wiki
Jump to: navigation, search

Under: "Add a root taxon name to your table," I created the root record in the taxon_name table successfully:

insert into taxon_names (name, l, r, creator_id, updator_id) values ('root', 1, 2, 1, 1);

However, no taxa show up in the web interface of the database so I can't add new real taxa because there is no existing parent for the new taxa to be children off.

Contents

typo

gem install redcloth 

should be

gem install RedCloth

set "editable taxon names" in /admin

The level at which a user can edit the taxonomic name heirarchy (not OTUs!) can be set on the admin tab. Assign the 'root' taxon to admin, enter a couple of names, and then assign those children to your various users.


still not sure

I found the "editable taxon names" in the /admin page. When I click on the admin's name I can choose 'root' from the drop down list below "Add a name". After submitting that with the Add button, I get this:

Error creating thumbnail: Unable to save thumbnail to destination

I'm not sure what to do from there. No taxa show up in the "Taxon names" tab when logged in as the admin to a test project.

Kweskm 15:41, 13 February 2008 (CST)

Aha. You should be seeing "root" there, but since you added the name from the database the TaxonName.display_name hasn't been generated. To generate the name for the first time click 'Renumber (reindex) all taxon names (also rebuilds display_name)' on the administrator interface. Then check back and see if you see "root" there (untested, but likely the case. --matt 20:10, 13 February 2008 (CST)


A resolution to the adding taxa issue

I think I figured it out. The step I was missing was going to the Visiblity page of the "Taxon names" tab. There I can enter root in the species name picker to make it visible to this project and then I can add children taxa. The lack of 'root' next to the checkbox is because the mysql record creation:

insert into taxon_names (name, l, r, creator_id, updator_id) values ('root', 1, 2, 1, 1);

doesn't include data for the display_name field. I'm going to update the install wiki to be:

insert into taxon_names (name, display_name, l, r, creator_id, updator_id) values ('root', 'root', 1, 2, 1, 1);

and I'm going to add something about the visibility option.

Kweskm 14:50, 14 February 2008 (CST)

Another question re image uploads

I'm getting an error when I try to upload images or link to Morphbank images. First the odd thing. I'm only having this problem on one of the computers where I've tried installing mx, so I thing it's an install problem rather than an mx script error. The error is:

ActiveRecord::StatementInvalid in ImageController#create Mysql::Error: #23000Column 'file_name' cannot be null: INSERT INTO images (`created_on`, `file_type`, `taken_on_month`, `creator_id`, `file_name`, `updated_on`, `file_size`, `user_file_name`, `file_md5`, `notes`, `taken_on_year`, `technique`, `height`, `proj_id`, `ref_id`, `owner`, `mb_id`, `taken_on_day`, `updator_id`, `width`) VALUES('2008-02-13 16:49:21', 'png', NULL, 1, NULL, '2008-02-13 16:49:21', 289765, 'Picture2.png', '4390684438f0da000f2050d87241d9a5', , NULL, , 900, 1, NULL, , NULL, NULL, 1, 1440)

RAILS_ROOT: ./script/../config/..

and then more lines listed under Trace and Request.

I've compared the good and bad computers and they both have the same rail version (1.2.6) and gems. I've tried different browsers and webservers (WEBrick and Mongrel). I tried uploading under gel image and I got the same error. There were some differences in the installation of ruby in the two computers and one is a Mac OS 10.4 G4 and the other is 10.4 intel. I've tried different image formats and files. Imagemagick convert and identify work from my path, but the error doesn't seem be related to that.

- Hard to say what's going on there. Are the right permissions set? Check them for ImageMagik on both machines. There are definitely some differences b/w Mac and PC setups for loading images, but we've never worked with 10.4 intel. You might have to use the debugger and check things out. In the image.rb model there are a number of methods that get called that load the image, one of them grabs information. For example edit and add 'breakpoint' at the bottom of 'def record_image_details'. Try loading an image, the breakpoint will get hit and the browser will pause, do 'ruby script/breakpointer' from the installation root, and you'll run the breakpoint shell. You can then do things like type the name of the variable in the code to see what its storing. Typing 'exit' will exit the breakpoint and the page will finish loading. --matt 20:23, 13 February 2008 (CST)

The other weird image related things is that when I go to add a image link from morph bank. I enter the morphbank numer and OTU (via the ajax dropdown) and I always get a little error message saying "Failed to add Morphbank image, did you include an OTU?" This also works on the other install I tried. Any thoughts about where to go for debugging this problem?

Kweskm 15:58, 13 February 2008 (CST)

You're likely not using the blue dropdowns correctly. You must always choose the name from the dropdown, not just type it in. Choose it by clicking the name, or tabbing out when you have the name you want selected. I highly recommend installing the webdev toolbar for firefox in this regard. From there do Forms->show form details, you'll see the hidden field that gets set when you select from the ajax dropdown. If a number appears you know its getting set correctly, if the problem persists we'll have to further debug it. --matt 20:23, 13 February 2008 (CST)

I figured out that the problem here and with the image upload is that the variable file_name isn't being set to "" in the file saving method (I don't remember the exact method name right now). I was able to patch the problem with the image upload by adding

 self.file_name =  

To the bottom of the section "def record_image_details" in models/image.rb where the other attributes are being set for the images (such as width and height). I'm not sure why the method that loads in the image isn't setting the file_name to "" correctly, but it is also causing problems with the morphbank image linking. I'm going to look into the source of the problem. Maybe something with the rails dependency that was installed?

Kweskm 09:03, 19 February 2008 (CST)

Careful with that patch, I'm not sure it will work as you expect. The file_name is calculated (indexed) a little further down in

 def calc_file_name
   self.file_name = "#{self.id}_mximage"
   self.class.update_all("file_name = '#{self.file_name}'", "id = #{self.id}")
 end

You're causing the code to not hit that when

 def store_and_derive_files
   calc_file_name unless self.file_name? 

gets hit it looks like. That line is for post-processing only IIRC, i.e. if we want to use the same code to re-derive the smaller images. You should see images being loaded in the directory as 1_mximage.<ending>. The Morphbank subclass completely ignores the local file step by basically wiping out the validation. I.e. the file_name related code should never be called for a Morphbank image. So- I think you're likely hitting another problem all together. I'd try first to check out what's going on with

 @details = im_identify(@temp_file.local_path)

In record_image_details. Does @details contain anything at all? (use a breakpoint). im_identify is in /lib/image_manipulation.rb. Maybe a path problem? --matt 17:39, 19 February 2008 (CST)

RubyGems

It is unclear to me what action is required at this step. The link behind RubyGems is no longer helpful, leading to a non-informative page.

How do I install the Ruby package manager RubyGems on various Linux distros?

--Gregor Hagedorn 07:09, 28 September 2010 (UTC)

Personal tools