Re: Release?

2009-06-11 Thread Magnus Holm
Totally right :-)
It's released now...

//Magnus Holm


On Thu, Jun 11, 2009 at 01:12, Julik Tarkhanov
julian.tarkha...@gmail.comwrote:


 On 10 Jun 2009, at 23:49, Magnus Holm wrote:

  Oh, sorry. I totally forgot about this.

 Are we absolutely sure that 1.5.180 is stable enough to be pushed out to
 Rubyforge?



 For about a year I think, and if not it can be followed by 1.5.181 right?
 --
 Julik Tarkhanov
 m...@julik.nl





 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 http://rubyforge.org/mailman/listinfo/camping-list

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Camping tutorials for education?

2009-06-11 Thread David Susco
Scratch that, got everything working with 1.8.7-p173 and selinux
disabled. I have to say, rack apps are pretty easy to deploy with
passenger once you get the thing installed and working :P.

@Jonathan - Re: your apache conf, I actually didn't need the directory
directive and the execcgi option to get this to work. Why did you list
it?

So here's my TODO list:

1. Try to get it working with selinux enabled.
2. Put together a tutorial for the wiki (which one would you guys like
to see it on? github?)
3. Look into performance and security. Would installing fastcgi or
something similar speed passenger up any?

On Wed, Jun 10, 2009 at 8:45 PM, David Suscodsu...@gmail.com wrote:
 OK, good to know. What the latest version I can use?

 Dave

 On Wed, Jun 10, 2009 at 5:46 PM, Magnus Holmjudo...@gmail.com wrote:
 Unfornately, Camping doesn't (yet) work on Ruby 1.9.1. Unless someone else want to try
 now, I'm going to have a look at it *after* 2.0 is released.

 //Magnus Holm


 On Wed, Jun 10, 2009 at 22:30, David Susco dsu...@gmail.com wrote:

 I've disabled SELinux to see if I could get any farther.

 I managed to get passenger installed and working, however a fancy
 passenger generated page is telling me the app couldn't be started due
 to this error:

 `require':
 /usr/local/lib/ruby/gems/1.9.1/gems/camping-1.9.316/lib/camping.rb:11:
 syntax error, unexpected tLABEL (SyntaxError)
 p[0]==?/?...@root+p:p end;def URL c='/',*a;c=R(c,...

 It's the same thing when I try to rackup the .ru file, and the same
 when I try to execute this little bit of code:

 #!/usr/bin/env ruby -rubygems
 gem 'camping', '=1.9.316'
 %w(rack camping).each { |lib| require lib }
 puts 'done'

 I'm tried reinstalled camping 1.9.316 but that didn't change anything.
 Any ideas?

 Dave

 On Wed, Jun 10, 2009 at 10:39 AM, David Suscodsu...@gmail.com wrote:
  I'm trying to get passenger working presently, once I do I'll let you
  know how the rest of it goes.
 
  When I try to load the module in the apache conf I get the following
  error:
 
  Cannot load
  /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
  into server:
  /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so:
  failed to map segment from shared object: Permission denied
 
  I'm assuming it's an SELinux problem, has anyone run into it before?
  I've done the following already, so it hasn't helped:
 
  http://www.modrails.com/documentation/Users%20guide.html#_the_apache_error_log_says_that_the_spawn_manager_script_does_not_exist_or_that_it_does_not_have_permission_to_execute_it
 
  Dave
 
 
  On Tue, Jun 9, 2009 at 11:28 AM, Jonathan Grollli...@groll.co.za
  wrote:
  Hi David,
 
  On Tue, Jun 09, 2009 at 09:29:22AM -0400, David Susco wrote:
 
  I'd definitely be interested in seeing any work you do with this.
  Having it up on the wiki would be nice too.
 
  I'm still trying to figure out deployment with camping 1.5. I've
  experimented with 1.9.316 and rack but have yet to get an app to work
  with that. The same with Picnic.
 
  Been meaning to write a quick overview of how I did it for you (as
  documentation is super sparse still). Briefly:
 
  (1) Read the passenger user guide at:
  http://www.modrails.com/documentation/Users%20guide.html
 
  I installed passenger from a gem but see the user's guide if you need
  to install on debian using apt (it is in the Ubuntu repositories
  already).
  Similarly rack is from a gem, and I use the same version of camping as
  you (from Judofyr's gem server).
 
  (2) Try and get the hello world from the passenger user guide to
  work for you.
 
  (3) Then try and get the blog example working that is shipped with
  camping. Here is a config.ru that works for that:
 
  require 'rubygems'
  require 'rack'
  require 'camping'
  require 'blog'
  Blog::Models::Base.establish_connection :adapter = sqlite3,
  :database = /home/jonathan/.camping.db
  run Blog
 
  Change the database path to one you have on your system. You may need
  something like:
  Blog::Models.create_schema :assume = (Blog::Models::Post.table_exists?
  ?
  1.0 : 0.0)
 
  before run blog if your sqlite database doesn't yet have the schema
  for the blog example.
 
  (4) And the apache config that I used was something like:
 
  Directory /
               Options ExecCGI FollowSymLinks
                  AllowOverride all
                     Allow from all
  /Directory
  VirtualHost *:80
     ServerName www.rackexample.com
     DocumentRoot /var/www/blog/public
  /VirtualHost
 
  You may need to edit your hosts file so that www.rackexample.com
  resolves to your apache server.
 
  (5) Let us know how it goes...
 
  Regards,
  Jonathan
  ___
  Camping-list mailing list
  Camping-list@rubyforge.org
  http://rubyforge.org/mailman/listinfo/camping-list
 
 
 
 
  --
  Dave
 



 --
 Dave
 ___
 Camping-list mailing list
 Camping-list@rubyforge.org
 

Re: sqlite3 connection problem

2009-06-11 Thread Jonathan Groll

On Tue, Jun 09, 2009 at 11:35:26AM +0100, Dave Everitt wrote:
Any feedback appreciated on the following. My most recent attempt to  
identify the issue is a minimal Ruby/SQLite/ActiveRecord script, Pastied 
here: http://pastie.textmate.org/492514 which brings up the following 
when run from the command line (an empty database file already exists):


$ ./simple_db.rbx
[SNIP]/active_record/connection_adapters/sqlite3_adapter.rb:29:in  
`table_structure': Could not find table 'users' 


(1) Not really a 'camping' related pastie. See (3) for the same thing
done the 'camping way'.

(2) There seems to be nothing in the code above telling activerecord
to create your database schema unless you're doing seperate rake
db:migrate scripts outside of this script.  My suspicion, therefore is
that the 'users' table simply does not exist in your database.

(3) This is a full working solution for camping 1.5:
#!/usr/bin/env ruby

$:.unshift File.dirname(__FILE__) + /../../lib
require 'camping'

Camping.goes :Dave

module Dave::Models
  class User  Base
  end
  class CreateTables  V 1.0
def self.up
  create_table :dave_users, :force = true do |t|
t.column :id,   :integer, :null = false
t.column :name, :string,  :limit = 255
t.column :password, :string,  :limit = 255
  end
  def self.down
drop_table :dave_users
  end

end
  end
end

module Dave::Controllers
  class Index  R '/'
def get
  user = User.new()
  user.id = dave
  user.name = Dave Everitt
  user.password = davepass
  user.save

  # user = User.find(dave)
  # user.destroy()

  render :fin
end
  end
end

module Dave::Views
  def fin
Finished, no errors
  end
end

def Dave.create
  Dave::Models.create_schema :assume = (Dave::Models::User.table_exists? ? 1.0 
: 0.0)
end


***
Save this file as dave.rb. Note the Dave::Models.create_schema call
(as per point 2 above)

To get this to work I have the following gems installed:
$ gem list

*** LOCAL GEMS ***

activerecord (2.3.2)
activesupport (2.3.2)
builder (2.1.2)
camping (1.5.180)
markaby (0.5)
metaid (1.0)
sqlite3-ruby (1.2.4)

I run it with:
camping dave.rb

I then visited http://localhost:3301/ with my browser (which showed
Finished, no errors).

To confirm that there is a table in the sqlite database with the
correct fields and with one record:

$ sqlite3 ~/.camping.db
SQLite version 3.6.10
Enter .help for instructions
Enter SQL statements terminated with a ;
sqlite .tables
dave_schema_infos  dave_users sessions 
sqlite .header on

sqlite select * from dave_users;
id|name|password
0|Dave Everitt|davepass

Hope some of the above points you in the 'right' direction.

Cheers,
Jonathan.
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: The D-word

2009-06-11 Thread Cornelius Jaeger

hiya

chiming in a little late.
but i think many people would be attracted to a basic cms, as often as  
it's been done. possibly without all the role and permissions fuss but  
a basic page hierarchy and editable pages so people can make their  
scrap books, photo albums and so on. make it very basic, and explain  
it well, and then every other month it can be expanded on, add an ajax  
sprinkle, add a permissions/group role what have you.

must have's.

1. db access, how to setup, run etc.
2. illustrate various types of relationships, hierarchical would be  
nice to show :-)

3. file upload and management, file delete on record delete etc.
4. login / logout for the basic admin user


then every other month or when someone adds a feature (eg, ajax rich  
text editing, user and group roles) or mutates it for a specific  
purpose (photo album, address book) we can make a tutorial out of it.  
Using our basic cms structure...


i'd be glad to contribute some of the writing and such, i'm quite  
fluent in english and my grammar is a lot more robust than my emails  
would lead you to believe. i'd need help with the coding though, since  
i'm new to ruby and camping and i've honestly been sort of following  
along from the side lines. it's a hobby but one i'd be willing to  
invest time on if the community is interested.


just my 2cents

best

cornelius


On 09.06.2009, at 23:56, Magnus Holm wrote:


Oh, that would be very nice!

Right now there is an example at camping.rubyforge.org showing a  
blog skeleton (with controllers, models and views). It might be  
better to rather have a tiny, fully functional one (to get the feel  
of Camping), and a link to blog.rb (which should be simplified even  
more, and actually work). The book could then take it from there and  
slightly expand into the blog.rb (or maybe even totally different;  
we should at least end up with something)


You know, I remember stumbling on Camping after trying out Rails,  
and it was a horrible feeling ending up at page 3 of the tutorial  
(on the old wiki) where a giant TODO screamed at me. I think many  
newcomers would have a look at alternatives to Rails, and it would  
be great if we could guide them not only through Camping, but also  
on the way you have to think when you're developing on the web.  
Without boring them too much. At the same time, there will probably  
be some Rubyists/webdevs who just want to learn about Camping too.


What if we start easy with lots of code and introduce them to  
Camping, then (if we bother to) more in-depth about the web, HTTP,  
GET/POST/PUT/DELETE, limitations? You could follow the book right  
through and will end up with basic understanding of the web, or just  
skip after the quickstart (and three months later, after you've  
experimented a bit, you take the trouble to trouble to read the rest).


Maybe book is the wrong word for this too. A book is so formal and  
strict. This should be light, simple and something you just can dive  
right into whenever you want. Let's keep it simple and precise, yet  
informal!


The API as a cheat is a great idea too, let's not forget that :-)

When it comes to the dependency on Rack, I'm not that worried. You  
almost can't do any webdev in Ruby today without meeting on Rack.  
And you only need to have the Rack-library somewhere where Camping  
can find it (just download and unzip it to vendor/rack for  
instance), even though using the gem is preferred.


Anyone else want to chime in? (Yes, you do!)

I currently have some RDoc templates which renders the book/readme/ 
api. It definitely needs to be cleaned up a lot, but I guess I can  
push it out at a branch when I get back to my computer.


//Magnus Holm


___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list