Pakyow Installation

34 views
Skip to first unread message

Austin S

unread,
Jan 7, 2013, 5:34:24 PM1/7/13
to pak...@googlegroups.com
I followed the instructions to install pakyow in the manual (should be easy, like it said), but I keep getting this error when trying to setup a new webapp "pakyow: command not found." -- I made sure all needed gems were installed, and the installation says that it has completed correctly:
"Successfully installed pakyow-0.7.2
1 gem installed
Installing ri documentation for pakyow-0.7.2...
Installing RDoc documentation for pakyow-0.7.2..."

Any ideas?

bryanp

unread,
Jan 7, 2013, 5:36:46 PM1/7/13
to pak...@googlegroups.com
What operating system are you installing on?

Also, if you're using rbenv that could be the culprit. You will need to run `rbenv rehash` before the executables are available.

Bryan

Austin S

unread,
Jan 9, 2013, 11:29:22 AM1/9/13
to pak...@googlegroups.com
That one was Ubuntu 11.04 -- I tried the rbenv rehash, but the problem turned out to be the way the machine was setup. It is on a network where I am not a local administrator, and apparently that caused some issues. So, once I installed it on my copy of Mint then it worked out okay. Thank you for the suggestion and your quick response.

Also, out of curiosity, are there any example/template apps created with Pakyow that I could snag a copy of to play around with to understand the structure a bit better? I'm working on a small web app (frontend only, with content generated from API calls in Ruby) and I am trying to get the hang of the structure of framework. Thanks!

bryanp

unread,
Jan 9, 2013, 12:10:14 PM1/9/13
to pak...@googlegroups.com
Glad it's working for you!

The 0.7 test app we've been pointing people to is here: https://github.com/metabahn/pakyow-web. It's pretty simple, but should get you started.

That said, we're getting very close to launching 0.8. Since there are significant differences between 0.7/0.8 it might be best to start there. A 0.8 test app can be found here: https://github.com/metabahn/paktest-0.8. It installs pakyow from the master branch, which includes the 0.8 features. 0.8 is feature-complete, it just needs more testing. We're also rewriting the documentation.

Either route you choose, let us know if you have questions!

nathan claburn

unread,
Jan 9, 2013, 12:16:52 PM1/9/13
to pak...@googlegroups.com
I have small app I wrote to familiarize myself with Pakyow. It's based on 0.7
 

Austin S

unread,
Jan 10, 2013, 3:29:50 PM1/10/13
to pak...@googlegroups.com
Thanks for the test apps and information. They are a huge help to go through to try to understand the depth of the framework.

While I am here, I have another question concerning the structure of the framework as I try to setup my app. If I have a form that I need to grab entered text and store for later use in an API call, would it be best to use a hook that runs after that page (and form) is submitted or a hook that runs before the next page (route) is loaded (or neither)?

Bret Young

unread,
Jan 10, 2013, 4:07:58 PM1/10/13
to pak...@googlegroups.com

If I understand your question correctly, the form values will be in the request object (specifically, request.params) that you have available from any route controller logic. A hook just is just a way to define some logic that can be reused across different controllers as something that runs before and/or after the main controller code. The route causes some code to be executed and a response generated. A hook is a way to subdivide that logic. Depending on how many other routes you get the form data from, a hook may or may not be the best thing.

BTW, this is a lot better in 0.8. 

Let us know if that helps. If not, I'll try again.

Bret

Austin S

unread,
Jan 10, 2013, 7:01:23 PM1/10/13
to pak...@googlegroups.com
1) Unfortunately I didn't fully get that... I am still unable to actually access the form text data in my ruby code.  From what I understand, it should be able to be accessed from the 'index' or 'results' (another page) controller in the application_controller.rb file.  What's odd to me is that when I debug in browser, I see no post data whatsoever from my form. (I feel like I'm forgetting something simple after only programming for too long in things like VB that handled this background stuff.)

2) I also tried setting up a test get request with a test JSON file and have no network activity there either.

Here's a pastebin of what I have as of now (for 2) http://pastebin.com/TNPtnDg0
I had included a line in the 'results' definition (line 32 of the full paste) in application_controller.rb attempting to access the string entered to the form, but had no luck.

Austin S

unread,
Jan 11, 2013, 10:23:23 AM1/11/13
to pak...@googlegroups.com
I went to setup your app to check to see how your controllers were setup and see if mine were setup correctly.... I setup the gems with bundler and went to run the app to check it out and received this error: 

/home/austin/senior_project/test_app2/config/application.rb:23:in `block in <class:Application>': undefined local variable or method `configure' for Pakyow::Configuration::Base:Class (NameError)
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/lib/core/application.rb:125:in `instance_eval'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/lib/core/application.rb:125:in `block in load_config'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/lib/core/application.rb:123:in `each'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/lib/core/application.rb:123:in `load_config'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/lib/core/application.rb:105:in `prepare'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/lib/core/application.rb:23:in `run'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/lib/commands/server.rb:7:in `<top (required)>'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/bin/pakyow:11:in `require'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/gems/pakyow-core-0.7.2/pakyow-core/bin/pakyow:11:in `<top (required)>'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/bin/pakyow:19:in `load'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/bin/pakyow:19:in `<main>'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/bin/ruby_noexec_wrapper:14:in `eval'
from /home/austin/.rvm/gems/ruby-1.9.2-p290/bin/ruby_noexec_wrapper:14:in `<main>'

Is this something with my Ruby or gems install or something else?

bryanp

unread,
Jan 11, 2013, 10:32:26 AM1/11/13
to pak...@googlegroups.com
From what I gather you want to create a form that submits results to '/results'. If so, set your form action to '/results', with a method of 'post':

<form action="/results" method="post">
...
</form>

Then change your `get 'results'` route to `post 'results'`. When you submit the form you will be able to access the submitted data via the `request.params` hash.

For the configuration error, which app are you attempting to run?

nathan claburn

unread,
Jan 11, 2013, 10:32:44 AM1/11/13
to pak...@googlegroups.com
Austin, after some searching it looks like you're trying to use my example. if so, then  "configure" is defined in an external file that defines setup information for the development environment. It's not in source control because it contains server/database specific information, which you wouldn't want in public. Replace the call on line 23 with something like this...
 
      app.log = true
      #DataMapper::Model.raise_on_save_failure = true
      DataMapper::Logger.new("#{Dir.pwd}/log/datamapper.log", :debug)
       DataMapper.setup(:default, 'sqlite://project.db')

 

Hope this helps.
Reply all
Reply to author
Forward
0 new messages