Forum: Radiant CMS script/extension install in production mode

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ben M. (Guest)
on 2008-10-13 06:20
How can I set "ruby script/extension install [gallery]" to run in
production mode?

[concrete]$ ruby script/extension install gallery
Initialized empty Git repository in /tmp/gallery/.git/
remote: Counting objects: 759, done.
remote: Compressing objects: 100% (320/320), done.
remote: Total 759 (delta 378), reused 759 (delta 378)
Receiving objects: 100% (759/759), 230.00 KiB, done.
Resolving deltas: 100% (378/378), done.
rake aborted!
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

(See full trace by running task with --trace)
rake aborted!
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

(See full trace by running task with --trace)

This error usually happens when I forget to include 'production' in a
rake command. I'm not sure how to specify the environment in a "ruby
script" command.

Thanks in advance!
Ben
Jim G. (Guest)
on 2008-10-13 06:33
(Received via mailing list)
script/extension install gallery RAILS_ENV=production
Ben M. (Guest)
on 2008-10-13 06:40
Jim G. wrote:
> script/extension install gallery RAILS_ENV=production

Hmm.. still get the same:

[concrete]$ ruby script/extension install gallery RAILS_ENV=production
gallery is already installed.

[concrete]$ ruby script/extension uninstall gallery RAILS_ENV=production
rake aborted!
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


My development setting in database.yml is:

development:
  adapter: mysql
  database: radiant_dev
  username: root
  password:
  socket: /tmp/mysql.sock

...which is why I think it is using that setting rather than production.
john (Guest)
on 2008-10-13 08:22
(Received via mailing list)
Looks like you should also be able to set

ENV['RAILS_ENV'] ||= 'production'

in environment.rb
Ben M. (Guest)
on 2008-10-13 08:32
john wrote:
> Looks like you should also be able to set
>
> ENV['RAILS_ENV'] ||= 'production'


Thanks for the suggestion John, but I already uncommented that line.
Adam van den Hoven (Guest)
on 2008-10-13 10:16
(Received via mailing list)
Ben,

If you look at the article on setting up radiant on Dreamhost, you'll
see that I only install Ray using script/extension and after that I
would use:

rake production ray:ext name=gallery hub=pilu fullname=radiant-gallery

There is nothing special about DH in this respect, I would suggest it
to anyone.
Ben M. (Guest)
on 2008-10-13 17:12
Adam van den Hoven wrote:
> Ben,
>
> If you look at the article on setting up radiant on Dreamhost, you'll
> see that I only install Ray using script/extension and after that I
> would use:
>
> rake production ray:ext name=gallery hub=pilu fullname=radiant-gallery

With script/extension I couldn't get Ray to install, so I tried it
manually. I FTP'd the Ray directory to vendor/extensions and ran "rake
production radiant:extensions:ray:migrate". I got:

rake aborted!
Don't know how to build task 'radiant:extensions:ray:migrate'


However the Ray code is installed the proper directory:
-vendor
--extensions
---ray
----.git
----lib
----spec

Any ideas?
Jim G. (Guest)
on 2008-10-13 17:19
(Received via mailing list)
On Oct 13, 2008, at 9:12, Ben M. <removed_email_address@domain.invalid> wrote:

> With script/extension I couldn't get Ray to install, so I tried it
> ---ray
> ----.git
> ----lib
> ----spec
>
> Any ideas?
> --

There is no migrate task for Ray. All you need to do is place it in
vendor/extensions and start using it.
Ben M. (Guest)
on 2008-10-13 18:20
Jim G. wrote:
> There is no migrate task for Ray. All you need to do is place it in
> vendor/extensions and start using it.

You are correct! Thank you all for your help, everything is working
perfectly now.
john (Guest)
on 2008-10-13 22:40
(Received via mailing list)
>> Jim G. wrote:
>>
>> script/extension install gallery RAILS_ENV=production
>
> Hmm.. still get the same:

>> john wrote:
>>

>> Looks like you should also be able to set
>> ENV['RAILS_ENV'] ||= 'production'
>
> Thanks for the suggestion John, but I already uncommented that line.


Sorry, I didn't test it I just had a quick glance at the code and
guessed it would work.

>> Ben M. wrote:
>>
>> With script/extension I couldn't get Ray to install

Do you happen to recall the error? Or was is just the error messages
from trying to run the migrate/update rake tasks that made you think
there had been a problem?

In any event, I just added migrate/update tasks to ray, so now instead
of rake errors you will get a friendly "No migrations/updates
necessary." message. Sorry if the lack of these tasks caused any issue.
Ben M. (Guest)
on 2008-10-15 05:28
john wrote:
> Do you happen to recall the error? Or was is just the error messages
> from trying to run the migrate/update rake tasks that made you think
> there had been a problem?

Yes, it was only the error messages about the migrate/update tasks.

> In any event, I just added migrate/update tasks to ray, so now instead
> of rake errors you will get a friendly "No migrations/updates
> necessary." message. Sorry if the lack of these tasks caused any issue.

^ This solution is great!
This topic is locked and can not be replied to.