Re: [Radiant] Re: Radiant on Heroku - Extension problem

2011-02-08 Thread Fima Leshinsky
I just went through this dance last week :) Check out:
http://docs.heroku.com/constraints#git-submodules

Also here's the quick and easy way to install extensions that play
well w/ Heroku:
$ git clone git://github.com/saturnflyer/radiant-vhost-extension.git
vendor/extensions/vhost

and optionally/when available:
$ rake radiant:extensions:extension_name:update
$ rake radiant:extensions:extension_name:install

then push to Heroku!
$ git push heroku master
$ heroku db:push

Hope that helps!

On Tue, Feb 8, 2011 at 2:42 AM, Hadi S. poph...@gmail.com wrote:
 ok, i figured out why the extensions directory is empty. git added
 those as submodules, so git never pushed them to the server. Now i
 have to figure out how to remove the submodule and add the extensions
 as normal content.

 On Feb 8, 10:17 am, Hadi S. poph...@gmail.com wrote:
 Hi

 i successfully pushed a radiant project to heroku. everything works
 fine except that the extensions in vendor/extensions aren't loaded.
 Although locally everything works fine, the extensions in the
 extensions directory are empty on heroku, So what could the cause be?


Re: [Radiant] Re: installing scoped_access plugin?

2011-02-08 Thread Fima Leshinsky
Thanks Jim - that's exactly what I was trying to do. Here's were I'm
getting stuck:

$ gem install radiant-vhost-extension
(update config/environment.rb with: config.gem
'radiant-vhost-extension', :lib = false)
$ rake production radiant:extensions:vhost:update
$ rake production radiant:extensions:vhost:install --trace
(in /Users/fimaleshinsky/Sites/heroku)
** Invoke production (first_time)
** Execute production
** Invoke environment (first_time)
** Execute environment
** Invoke radiant:extensions:vhost:install (first_time)
** Invoke environment
** Invoke radiant:extensions:vhost:migrate (first_time)
** Invoke environment
** Execute radiant:extensions:vhost:migrate
** Invoke radiant:extensions:vhost:apply_site_scoping (first_time)
** Invoke environment
** Execute radiant:extensions:vhost:apply_site_scoping
rake aborted!
no such file to load --
/Users/fimaleshinsky/Sites/heroku/lib/tasks/add_site_columns

Any ideas?

On Tue, Feb 8, 2011 at 9:24 AM, Jim Gay j...@saturnflyer.com wrote:
 On Feb 8, 2011, at 12:14 , Fima Leshinsky wrote:

 Thanks John! So odd. It worked on the Empty database template
 install but when I tried to run it w/ any of the other options it
 failed:

 Select a database template:
 1. Empty
 2. Roasters (a coffee-themed blog / brochure)
 3. Simple Blog
 4. Styled Blog
 [1-4]: 1

 Any ideas how to get the Roasters template to work w/ the vhost extension?

 Try setting up your template first, and then install the extension (you can 
 move it out of vendor/extensions and then move it back in if need be).

 I'm in the process of making this extension easier to use (it's not mine 
 originally) but haven't done much with it lately.

 -Jim


Re: [Radiant] Re: installing scoped_access plugin?

2011-02-08 Thread Fima Leshinsky
yup - same exact problem ..

Here's where this file is being required:

$ grep -r add_site_columns .
./lib/tasks/vhost_extension_tasks.rake:require
#{File.dirname(__FILE__)}/add_site_columns

On Tue, Feb 8, 2011 at 9:59 AM, john johnm...@gmail.com wrote:
 do you have the same problem if you install the extension into
 vendor/extensions?


Re: [Radiant] Re: installing scoped_access plugin?

2011-02-08 Thread Fima Leshinsky
The only file I have in lib/tasks is vhost_extension_tasks.rake .. is
lib/tasks/add_site_columns supposed to be copied over during the
extension install?

On Tue, Feb 8, 2011 at 10:05 AM, Fima Leshinsky flesh...@gmail.com wrote:
 yup - same exact problem ..

 Here's where this file is being required:

 $ grep -r add_site_columns .
 ./lib/tasks/vhost_extension_tasks.rake:        require
 #{File.dirname(__FILE__)}/add_site_columns

 On Tue, Feb 8, 2011 at 9:59 AM, john johnm...@gmail.com wrote:
 do you have the same problem if you install the extension into
 vendor/extensions?



Re: [Radiant] Re: installing scoped_access plugin?

2011-02-08 Thread Fima Leshinsky
yay! my first issue submission - i hope I didn't butcher it :P
https://github.com/saturnflyer/radiant-vhost-extension/issues/issue/10


On Tue, Feb 8, 2011 at 12:06 PM, Jim Gay j...@saturnflyer.com wrote:
 Would you mind opening up an issue for this?

 https://github.com/saturnflyer/radiant-vhost-extension/issues

 On Feb 8, 2011, at 14:54 , Fima Leshinsky wrote:

 Hm .. I also had to set site_admin = true to be able to login to the backend:

 ree-1.8.7-2010.02  user = User.find_by_login('admin')
 ree-1.8.7-2010.02  user.site_admin = true
 ree-1.8.7-2010.02  user.save!

 On Tue, Feb 8, 2011 at 11:34 AM, Fima Leshinsky flesh...@gmail.com wrote:
 Oh wow .. figured it out :) Is this a bug w/ the gem/extension?

 So it looks like add_site_columns.rb is part of the gem:
 $ ls -lh 
 ~/.rvm/gems/ree-1.8.7-2010.02/gems/radiant-vhost-extension-2.3.1/lib/tasks/
 total 24
 -rwxr-xr-x  1 fimaleshinsky  staff   1.2K Feb  8 10:02 add_site_columns.rb
 -rwxr-xr-x  1 fimaleshinsky  staff   5.6K Feb  8 10:02
 vhost_extension_tasks.rake

 I copied it over to lib/tasks and the install rake task completed like
 a charm ..
 $ cp 
 ~/.rvm/gems/ree-1.8.7-2010.02/gems/radiant-vhost-extension-2.3.1/lib/tasks/add_site_columns.rb
 lib/tasks/

 $ rake production radiant:extensions:vhost:install --trace
 (in /Users/fimaleshinsky/Sites/heroku)
 ** Invoke production (first_time)
 ** Execute production
 ** Invoke environment (first_time)
 ** Execute environment
 ** Invoke radiant:extensions:vhost:install (first_time)
 ** Invoke environment
 ** Invoke radiant:extensions:vhost:migrate (first_time)
 ** Invoke environment
 ** Execute radiant:extensions:vhost:migrate
 ** Invoke radiant:extensions:vhost:apply_site_scoping (first_time)
 ** Invoke environment
 ** Execute radiant:extensions:vhost:apply_site_scoping
 ==  AddSiteColumns: migrating 
 =
 -- add_column(layouts, :site_id, :integer)
   - 0.0397s
 -- add_column(pages, :site_id, :integer)
   - 0.0047s
 -- add_column(snippets, :site_id, :integer)
   - 0.0055s
 -- add_index(:snippets, [:name, :site_id], {:unique=true})
   - 0.0060s
 -- add_index(:snippets, [:name, :site_id])
   - 0.0007s
 ==  AddSiteColumns: migrated (0.0763s) 
 

 ** Execute radiant:extensions:vhost:install


 On Tue, Feb 8, 2011 at 11:31 AM, Fima Leshinsky flesh...@gmail.com wrote:
 The only file I have in lib/tasks is vhost_extension_tasks.rake .. is
 lib/tasks/add_site_columns supposed to be copied over during the
 extension install?




Re: [Radiant] vhost extension configuration

2011-02-08 Thread Fima Leshinsky
That seems very odd. How does Radiant know which site you're
requesting? In your examples, the browser wouldn't send an HTTP Host
header which is really the only way to differentiate between site A
and site B at the HTTP level.  Also localhost is just an entry in your
/etc/hosts file (assuming you're on a un*x-based system), which by
default is configured to resolve to 127.0.0.1. Since Radiant only sees
HTTP - both of those requests would appear identical to it.

In my case - Radiant is serving up the default site regardless of what
Host header it sees.

Do I need to make a change somewhere else to add new sites using the
vhost extension?

Interesting that the Site model doesn't contain a hostname field.
Where is the hostname of each site specified?

Site.find_each {|s| p s}
#Site id: 1, config: {title=Default}
#Site id: 2, config: {title=Effective Web Presence}

Thanks again!

 It depends on what you've setup.

 I'll often (in development) set one site to be localhost and another to 
 0.0.0.0 and another to 127.0.0.1
 All of those point back to your internal webserver and Radiant can answer for 
 3 different sites.

 Does that help?

 -Jim


Re: [Radiant] vhost extension configuration

2011-02-08 Thread Fima Leshinsky
Well I'm a complete N00b to RoR so please bare w/ me but I just discovered this:

ree-1.8.7-2010.02  ActiveRecord::Base.connection.tables
 = [schema_migrations, config, extension_meta, layouts,
page_parts, pages, sessions, snippets, users, sites_users,
hostnames, sites]

Woohoo! So there are Hostname and Sites_user models!

ree-1.8.7-2010.02  Hostname.find_each {|h| p h}
#Hostname id: 1, domain: *, port: 80, site_id: 1, created_at:
2011-02-08 17:07:06, updated_at: 2011-02-08 17:07:06
#Hostname id: 2, domain: www.fleshins.com, port: 80, site_id: 2,
created_at: 2011-02-09 04:24:11, updated_at: 2011-02-09 04:24:11
 = Hostname(id: integer, domain: string, port: string, site_id:
integer, created_at: datetime, updated_at: datetime)

For some reason I can't get to the Sites_user model though ..

ree-1.8.7-2010.02  Sites_user.find_each {|u| p u}
NameError: uninitialized constant Sites_user

Now if only I knew where to go next :P


Re: [Radiant] vhost extension configuration

2011-02-08 Thread Fima Leshinsky
Wow .. I stepped away for a bit .. reloaded the page and hit the +
New Homepage button again ... and ... it just worked .. wtf ..


Re: [Radiant] Re: Kramdown vs. markdown filter

2011-01-01 Thread Fima Leshinsky
so i removed the kramdown filter extension (rm -rf
vendor/extensions/kramdown-filter) and re-installed it as a gem:

$ gem install radiant-kramdown_filter-extension
+ added config.gem 'radiant-kramdown_filter-extension' to
config/environment.rb
+ restarted my app server

voila! kramdown works perfectly w/ the existing markdown filter :)

I'm still interested in how one would go about disabling/removing the
markdown filter that comes packaged w/ radiant so if you know and have a
minute to reply please do so


Re: [Radiant] Re: deploying radiant 0.9.1 with capistrano

2010-12-18 Thread Fima Leshinsky
looks like this was an issue w/ my env path from what i could tell -
everything is working fine now . i'm able to deploy + migrate cleanly.
woohoo!

On Fri, Dec 17, 2010 at 4:31 PM, Fima Leshinsky flesh...@gmail.com wrote:

 sigh so here's where things are failing for me now. This seems like it's
 specific to capistrano and not radiant :/

 * executing `deploy:update_code'updating the cached checkout on all
 servers
 executing locally: git ls-remote g...@github.com:fleshins/radiant.git
 master
   * executing if [ -d /var/www/html/radiant/shared/cached-copy ]; then cd
 /var/www/html/radiant/shared/cached-copy  git fetch -q origin  git reset
 -q --hard 04edfa7f2f3f00635ac7dcda343ab891cf06fd68  git submodule -q init
  for mod in `git submodule status | awk '{ print $2 }'`; do git config -f
 .git/config submodule.${mod}.url `git config -f .gitmodules --get
 submodule.${mod}.url`  echo Synced $mod; done  git submodule -q sync 
 git submodule -q update  git clean -q -d -x -f; else git clone -q
 g...@github.com:fleshins/radiant.git
 /var/www/html/radiant/shared/cached-copy  cd
 /var/www/html/radiant/shared/cached-copy  git checkout -q -b deploy
 04edfa7f2f3f00635ac7dcda343ab891cf06fd68  git submodule -q init  git
 submodule -q sync  git submodule -q update; fi

 I tried running this locally on the target server and got a syntax error.
 sad face :P



 On Fri, Dec 17, 2010 at 1:22 PM, Fima Leshinsky flesh...@gmail.comwrote:

 hm .. so it looks like git is placing the submodules (extensions) located
 in vendor/extensions in shared/cached-copy instead of the 'current'
 directory . do i need to symlink the extensions from the shared directory to
 'current'?


 On Fri, Dec 17, 2010 at 11:06 AM, Fima Leshinsky flesh...@gmail.comwrote:

 ok so the log file error is due to the log file not existing in my shared
 directory - not sure how to address it but probably not a show stopper

 the extension errors appear to be due to me not using Git properly? I
 found a thread that discusses having to use Git submodules to manage
 extensions .. going to play with that and see what happens :P





Re: [Radiant] Re: deploying radiant 0.9.1 with capistrano

2010-12-17 Thread Fima Leshinsky
hm .. so I got the database.yml symlink in place but now there's this. any
ideas how to debug it? the user that I'm connecting to the server with owns
all of the application tree so I'm not sure why it's complaining about
access to the log file. any ideas where to even begin?

  * executing cd /var/www/html/radiant/releases/20101217185342; rake
RAILS_ENV=production  db:migrate
servers: [172.116.1.12]
[172.116.1.12] executing command
 ** [out :: 172.116.1.12] (in /var/www/html/radiant/releases/20101217185342)
 ** [out :: 172.116.1.12] Rails Error: Unable to access log file. Please
ensure that /var/www/html/radiant/releases/20101217185342/log/production.log
exists and is chmod 0666. The log level has been raised to WARN and the
output directed to STDERR until the problem is fixed.
 ** [out :: 172.116.1.12] Could not load extension from file:
capistrano_extension.
 ** [out :: 172.116.1.12] #NameError: uninitialized constant
CapistranoExtension
 ** [out :: 172.116.1.12] Could not load extension from file:
code_ray_extension.
 ** [out :: 172.116.1.12] #NameError: uninitialized constant
CodeRayExtension
command finished


Re: [Radiant] Re: deploying radiant 0.9.1 with capistrano

2010-12-17 Thread Fima Leshinsky
ok so the log file error is due to the log file not existing in my shared
directory - not sure how to address it but probably not a show stopper

the extension errors appear to be due to me not using Git properly? I found
a thread that discusses having to use Git submodules to manage extensions ..
going to play with that and see what happens :P

On Fri, Dec 17, 2010 at 10:57 AM, Fima Leshinsky flesh...@gmail.com wrote:

 hm .. so I got the database.yml symlink in place but now there's this. any
 ideas how to debug it? the user that I'm connecting to the server with owns
 all of the application tree so I'm not sure why it's complaining about
 access to the log file. any ideas where to even begin?

   * executing cd /var/www/html/radiant/releases/20101217185342; rake
 RAILS_ENV=production  db:migrate
 servers: [172.116.1.12]
 [172.116.1.12] executing command
  ** [out :: 172.116.1.12] (in
 /var/www/html/radiant/releases/20101217185342)
  ** [out :: 172.116.1.12] Rails Error: Unable to access log file. Please
 ensure that /var/www/html/radiant/releases/20101217185342/log/production.log
 exists and is chmod 0666. The log level has been raised to WARN and the
 output directed to STDERR until the problem is fixed.
  ** [out :: 172.116.1.12] Could not load extension from file:
 capistrano_extension.
  ** [out :: 172.116.1.12] #NameError: uninitialized constant
 CapistranoExtension
  ** [out :: 172.116.1.12] Could not load extension from file:
 code_ray_extension.
  ** [out :: 172.116.1.12] #NameError: uninitialized constant
 CodeRayExtension
 command finished





Re: [Radiant] Re: deploying radiant 0.9.1 with capistrano

2010-12-17 Thread Fima Leshinsky
hm .. so it looks like git is placing the submodules (extensions) located in
vendor/extensions in shared/cached-copy instead of the 'current' directory .
do i need to symlink the extensions from the shared directory to 'current'?


On Fri, Dec 17, 2010 at 11:06 AM, Fima Leshinsky flesh...@gmail.com wrote:

 ok so the log file error is due to the log file not existing in my shared
 directory - not sure how to address it but probably not a show stopper

 the extension errors appear to be due to me not using Git properly? I found
 a thread that discusses having to use Git submodules to manage extensions ..
 going to play with that and see what happens :P



Re: [Radiant] Re: deploying radiant 0.9.1 with capistrano

2010-12-16 Thread Fima Leshinsky
Thanks for all the helpful posts. So I've got capistrano deploying my
github-hosted application to my staging server. Works great! I'm not using
bundler yet as I'm not sure of the benefits there. One of the problems I'm
running into is deploying migrations (capistrano complains that it's not
able to find /config/database.yml in the current release directory).

I've found a couple of blog posts describing solutions to the issue e.g.
http://www.simonecarletti.com/blog/2009/06/capistrano-and-database-yml/

I'm curious why none of your deploy.rb scripts contained any reference to
the database config file. How are you guys deploying migrations?


Re: [Radiant] deploying radiant 0.9.1 with capistrano

2010-12-14 Thread Fima Leshinsky
You guys are awesome will give this a shot. Where does bundler fit into all of 
this?


Re: [Radiant] Re: deploying radiant 0.9.1 with capistrano

2010-12-14 Thread Fima Leshinsky
hm .. if you're not using bundler then maybe i shouldnt either? maybe it's
overkill for a noob like me who's just starting out w/ ruby / radiant. how
do you handle the case where you want to play around w/ a gem in your dev.
environment but not deploy it to production?

On Tue, Dec 14, 2010 at 12:02 PM, Brad Herman bradley.t.her...@gmail.comwrote:

  I'm not entirely sure, but I would imagine you would just create a task
 for installing the bundle in your cap file.  LIke deploy:bundle:install or
 something along those lines.


Re: [Radiant] Re: Re: best code syntax highlighting solution

2010-12-13 Thread Fima Leshinsky
Looks like coderay is working well. I installed:

coderay gem + radiant extension @ https://github.com/phallstrom/code_ray

and now I can specify r:code blocks!

not sure what the benefits are of kramdown over the existing Markdown
radiant filter that comes with the Coffee blog template. If you guys can
shed some light on why kramdown is a better option I'd appreciate it.

Thanks again!
Fima


Re: [Radiant] Re: best code syntax highlighting solution

2010-12-12 Thread Fima Leshinsky
So looks like there are two radiant extensions below that allow you to
leverage the coderay gem:
https://github.com/phallstrom/code_ray
https://github.com/alno/radiant-code-extension

I'm inclined to use the the 2nd one since it supports other syntax
highlighters beyond coderay. What are your thoughts on which one to use?

Also, I'm curious, why use kramdown over the existing Markdown radiant
filter? Speed or other reasons as well?

Thanks!


Re: [Radiant] best code syntax highlighting solution

2010-12-08 Thread Fima Leshinsky
Thanks John - will take a look. Do you have any public pages you can share
as examples?


Re: [Radiant] Re: image 404s

2010-12-01 Thread Fima Leshinsky
Can you hit other assets in the /admin dir w/ curl and do u get a 200?

On Dec 1, 2010, at 6:02 PM, rosslaird r...@rosslaird.com wrote:

 Thanks for the help.
 Unless I've done something incorrectly, this:
 
 select * from page_parts where content like '%button.png%', etc.
 
 returns no results (I did this in PHPMyAdmin) for any of the tables
 with a content field.
 
 For the new-snippet.png 404 - that's a tough one. I'd use curl to debug it -
 
 Here's what I get from curl -svo /dev/null localhost/images/admin/new-
 snippet.png:
 
 GET /images/admin/new-snippet.png HTTP/1.1
 User-Agent: curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/
 0.9.8o zlib/1.2.3.4 libidn/1.18
 Host: localhost
 Accept: */*
 
 HTTP/1.1 404 Not Found
 Date: Thu, 02 Dec 2010 01:51:01 GMT
 Server: Apache/2.2.16 (Ubuntu)
 Vary: Accept-Encoding
 
 I'm not sure where to go next with that.
 
 So, overall, I am learning things (the upside) but not closer to
 resolving this (the downside).
 Thanks again for the help.
 
 Cheers.
 
 Ross


Re: [Radiant] Re: image 404s

2010-12-01 Thread Fima Leshinsky
Yup so your request path/URI is wrong. Do a:

$ pwd; ls -lh

inside your image directory

On Dec 1, 2010, at 8:08 PM, rosslaird r...@rosslaird.com wrote:

 Nope. I get 404 for them all.
 
 R.
 
 On Dec 1, 7:55 pm, Fima Leshinsky flesh...@gmail.com wrote:
 Can you hit other assets in the /admin dir w/ curl and do u get a 200?
 
 
 On Dec 1, 2010, at 6:02 PM, rosslaird r...@rosslaird.com wrote:
 
 Thanks for the help.
 Unless I've done something incorrectly, this:
 
 select * from page_parts where content like '%button.png%', etc.
 
 returns no results (I did this in PHPMyAdmin) for any of the tables
 with a content field.
 
 For the new-snippet.png 404 - that's a tough one. I'd use curl to debug it 
 -
 
 Here's what I get from curl -svo /dev/null localhost/images/admin/new-
 snippet.png:
 
 GET /images/admin/new-snippet.png HTTP/1.1
 User-Agent: curl/7.21.0 (i686-pc-linux-gnu) libcurl/7.21.0 OpenSSL/
 0.9.8o zlib/1.2.3.4 libidn/1.18
 Host: localhost
 Accept: */*
 
 HTTP/1.1 404 Not Found
 Date: Thu, 02 Dec 2010 01:51:01 GMT
 Server: Apache/2.2.16 (Ubuntu)
 Vary: Accept-Encoding
 
 I'm not sure where to go next with that.
 
 So, overall, I am learning things (the upside) but not closer to
 resolving this (the downside).
 Thanks again for the help.
 
 Cheers.
 
 Ross
 
 


Re: [Radiant] Re: How can i deploy radiant application to sub-directory?

2010-11-27 Thread Fima Leshinsky
Why wouldn't a web-server-level (e.g. Apache) rewrite work?

Thanks,
Fima