Cannot add a record.

79 views
Skip to first unread message

Ryszard Jeziorski

unread,
Dec 3, 2012, 3:01:52 AM12/3/12
to trac...@googlegroups.com
Hi,

Yesterday I installed Tracks v. 2.1 (Ruby 1.9.3, Rails 2.3.14). I had a few problems that I was able to solve, but the application still does not work.
When I try to add a context or projects, a message appears: "An error occurred while downloading from server error".


This is a message from production.log:
Processing ContextsController#create (for 222.11.231.235 at 2012-12-03 08:31:58) [POST]
  Parameters: {"authenticity_token"=>"YIPFBRU6G9mubcqncrvPazPh11ExOvG08Lp9fQzFgrI=", "context"=>{"name"=>"test", "hide"=>"0"}, "0"=>"_", "1"=>"s", "2"=>"o", "3"=>"u", "4"=>"r", "5"=>"c", "6"=>"e", "7"=>"_", "8"=>"v", "9"=>"i", "10"=>"e", "11"=>"w", "12"=>"=", "_source_view"=>""}

NoMethodError (undefined method `unscoped' for #<Class:0x0000000541d8b8>):
  /usr/local/share/gems/gems/will_paginate-2.3.16/lib/will_paginate/finder.rb:170:in `method_missing_with_paginate'
  /usr/local/share/gems/gems/acts_as_list-0.1.8/lib/acts_as_list/active_record/acts/list.rb:228:in `bottom_item'
  /usr/local/share/gems/gems/acts_as_list-0.1.8/lib/acts_as_list/active_record/acts/list.rb:220:in `bottom_position_in_list'
  /usr/local/share/gems/gems/acts_as_list-0.1.8/lib/acts_as_list/active_record/acts/list.rb:208:in `add_to_list_bottom'
  app/controllers/contexts_controller.rb:72:in `create'
 
Richard

Reinier Balt

unread,
Dec 3, 2012, 3:07:15 AM12/3/12
to trac...@googlegroups.com

2.1 is not supported on 1.9.3, please use ruby 1.8.7 or try the current 2.2devel which is supported on ruby 1.9.3

 

Reinier

 

--
You received this message because you are subscribed to the Google Groups "TracksApp" group.
To post to this group, send email to trac...@googlegroups.com.
To unsubscribe from this group, send email to tracksapp+...@googlegroups.com.
Visit this group at http://groups.google.com/group/tracksapp?hl=en.
 
 

Ryszard Jeziorski

unread,
Dec 3, 2012, 4:52:02 AM12/3/12
to trac...@googlegroups.com

Thanks for reply.
I installed Tracks 2.2devel and when I try to log in (through Passenger) I got an error:

ActionView::Template::Error (login.css isn't precompiled):
    2: <html xmlns="http://www.w3.org/1999/xhtml">
    3: <head>
    4:   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    5:   <%= stylesheet_link_tag "login" %>
    6:   <%= favicon_link_tag 'favicon.ico' %>
    7:   <%= favicon_link_tag 'apple-touch-icon.png', :rel => 'apple-touch-icon', :type => 'image/png' %>
    8: <title><%= @page_title -%></title>
  app/views/layouts/login.html.erb:5:in `_app_views_layouts_login_html_erb___3782731534503406726_35929660'
  app/controllers/users_controller.rb:56:in `new'
 

Reinier Balt

unread,
Dec 3, 2012, 8:11:52 AM12/3/12
to trac...@googlegroups.com

You need to compile the static assets (new in 2.2) See the upgrade manual.

 

bundle exec rake assets:precompile

 

Reinier

 

--

Ryszard

unread,
Dec 4, 2012, 5:57:20 AM12/4/12
to trac...@googlegroups.com
Thanks for your help.
After compiling static assets the program is working properly but only when I use the WEBrick server
(with config.serve_static_assets = true).
Unfortunatelly, when I run it through the Passenger, the program does not display icons.


Ryszard

Reinier Balt

unread,
Dec 5, 2012, 3:43:16 AM12/5/12
to trac...@googlegroups.com

In production mode behind apache/nginx/passenger serve_static_assets needs to be false. Then passenger will serve the precompiled assets that are stored in /public

 

Reinier

 

Van: trac...@googlegroups.com [mailto:trac...@googlegroups.com] Namens Ryszard
Verzonden: dinsdag 4 december 2012 11:57
Aan: trac...@googlegroups.com
Onderwerp: Re: [Tracks-discuss] Cannot add a record.

 

Thanks for your help.

--

Ryszard

unread,
Dec 6, 2012, 3:07:45 AM12/6/12
to trac...@googlegroups.com
I typed in the configuration file serve_static_assets = false,
and if I type the address in the browser http://localhost/tracks/assets/edit.png it displays the correct icon.
The problem is that in the place on a page where it should be an
icon indicating the editing, there is a reference to the address:
http://localhost/tracks/assets/blank-0159327f1130fb9db521f9e142225887.png.

Dan Rice

unread,
Dec 6, 2012, 11:56:41 AM12/6/12
to trac...@googlegroups.com
That's correct. The edit icon is applied in the stylesheet. But the stylesheet won't reference edit.png, either -- it, too, will use a hash at the end of the filename. It's currently "edit-9c5e87391c61a56b3313a0190b54c638.png," I believe. This is a feature of the Rails asset pipeline, and it's why you did a "bundle exec rake assets:precompile."

Are any of the hashed URLs working for you? Can you see http://localhost/tracks/assets/edit-9c5e87391c61a56b3313a0190b54c638.png?

Khrist Hansen

unread,
Dec 7, 2012, 12:39:27 AM12/7/12
to trac...@googlegroups.com
I have the same issue, but I am running ruby 1.8.7 with will_paginate-2.3.16 and acts_as_list-0.1.9 gems installed.

I am still relatively new to ruby, but would downgrading either of the gems fix this?

Thanks!

Khrist Hansen

unread,
Dec 7, 2012, 1:39:05 AM12/7/12
to trac...@googlegroups.com
I can confirm that downgrading to acts_as_list ver 0.1.4 fixed the issue of creating projects and contexts.  According to the gem's readme:

"All versions 0.1.5 onwards require Rails 3.0.x and higher."

Here are the steps on Linux to downgrade for anyone interested (assuming base directory of /opt/rubystack/apps/tracks/htdocs):

cd /opt/rubystack/apps/tracks/htdocs/

# Set acts_as_list to install only version 0.1.4 in Gemfile
# with sed or manually with editor
vi Gemfile
# or
sed -i'.bak' -e 's/^gem \"acts_as_list\",.*$/gem "acts_as_list", "0.1.4"/' Gemfile

# Update (i.e. downgrade) acts_as_list gem
bundle update acts_as_list

Hope that helps someone else out there!

Matt Rogers

unread,
Dec 7, 2012, 10:25:40 AM12/7/12
to trac...@googlegroups.com
On the 2.1 branch, I've just updated the Gemfile to only use 0.1.4

Thanks,
Matt

Ryszard

unread,
Dec 13, 2012, 4:33:01 AM12/13/12
to trac...@googlegroups.com
I see the edit icon when I type "http://localhost/tracks/assets/edit-9c5e87391c61a56b3313a0190b54c638.png" in my web browser.
But, as I wrote earlier, the Tracks pages contain links to the file "blank-... png" instead of "edit-.... png".

Ryszard

Dan Rice

unread,
Dec 13, 2012, 11:52:39 AM12/13/12
to trac...@googlegroups.com
And as I wrote earlier, that is correct behavior -- the edit icon is applied in the stylesheet (as a background-image). If you can see the image by visiting its URL directly, then either the stylesheet is not being linked correctly, or it contains incorrect references to the images.

Can you please paste the first 8 lines or so of the HTML source of your Tracks homepage?


Ryszard

unread,
Dec 13, 2012, 2:21:50 PM12/13/12
to trac...@googlegroups.com
Here are the lines:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <link href="/tracks/assets/application-74276964d55c682f69c99577b6ebc64c.css" media="all" rel="stylesheet" type="text/css" />
    <link href="/tracks/assets/print-9bc3b9fd06e9e9abbdbeeb0a89556840.css" media="print" rel="stylesheet" type="text/css" />
    <script src="/tracks/assets/application-0aa75d151c51808fbdf423ec3a3fadb5.js" type="text/javascript"></script>
    <meta content="authenticity_token" name="csrf-param" />

Dan Rice

unread,
Dec 13, 2012, 3:38:39 PM12/13/12
to trac...@googlegroups.com
Ok, that looks correct. Are the images the only visual problem? Are all the colors, layout, etc. correct?

The only thing I can think of is that the image paths are wrong in the CSS. Did you compile the assets after you set the value of "subdir" in config/site.yml? Try "bundle exec rake assets:clean" and "bundle exec rake assets:precompile" again to be safe.

If that's not the problem, please attach a copy of http://localhost/tracks/assets/application-74276964d55c682f69c99577b6ebc64c.css so I can validate its contents.

Dan Rice

unread,
Dec 13, 2012, 3:43:16 PM12/13/12
to trac...@googlegroups.com
Actually, your application.css has the same hash as my non-subdir installation of Tracks, so they're identical. No need to attach your application.css; I already know what it looks like. The image paths in your CSS must be the problem. I'll bet it's an issue with the subdir configuration. For the "/tracks" subdir you're using, the resulting application.css hash should be a4627469e7f9f0c3551caca5375d15b6.
Reply all
Reply to author
Forward
0 new messages