|
InstallingSubstruct
How to install Substruct
Installing SubstructIntroductionThis software package is developed using the Engines plugin. To find out more about how to use engines in general, go to http://rails-engines.org These directions assume you already have a working Rails hosting environment. This means...
These directions also assume you have some familiarity with developing Rails applications in general and a working knowledge of your file system. Installation0. Install the following gems...Substruct needs them to function properly.
gem install RedCloth gem install fastercsv gem install mime-types gem install mini_magick gem install ezcrypto !! NOTE !! Be sure openssl is also installed. For Debian linux boxes this is not included in the default Ruby installer. If you are running on debian it's as easy as typing 'apt-get install libopenssl-ruby1.8' 1. Download & extract the latest releaseAll releases are stored as tar / gzipped files here: http://code.google.com/p/substruct/downloads/list They are marked with version numbers. Grab the latest one and extract it. For instance, if you were working with release 0.97, you'd type the following on OS X and Linux tar -xzvf substruct_rel_0-97.tar.gz If you'd rather use SVN to download the latest code click here. 2. Set up your databases and edit your database.yml fileYou'll need to have a running MySQL or PGSql instance, and create the proper databases for use. We recommend the following:
Edit your database.yml file to make sure that Rails can access your database properly. For more information on the database.yml file, visit this url: http://wiki.rubyonrails.org/rails/pages/database.yml 3. Initialize your databaseRun this command from inside the substruct directory you extracted previously rake substruct:db:bootstrap UsageFire up your environment! ruby script/server Try to login to http://localhost:3000/admin as ''admin'' / ''admin'' MiscIf you're going to be doing credit card transactions you need a processor account. Check out how to get one. Make sure you check out how to maintain Substruct via cron as well. |
Sign in to add a comment
Note: after installing substruct you may want to go in to order_account.rb (model) and change the salt and/or password listed there, if you are concerned about security.
run rake db:create before rake substruct:db:bootstrap to create it (if desired)
The mini_magick gem is only a wrapper to the ImageMagick? command line tools. The lack of these tools makes the images not being resized and just a discrete error message is issued in the logs/shell.
Hi I have a strange error message when I try to fire up :
What did I done wrong ?
see http://groups.google.com/group/substruct/browse_thread/thread/b30511a0ca11d31e if you'd like to be able to edit files within /vendor/plugins/substruct and, in developer mode, have it automatically reload classes that change.
With regard to the mysql error, I'd say recreate your database from scratch, and try and run 'select from preferences' within a mysql command line to make sure it's working. Maybe myql is being run as a lesser privileged user?
Getting setup i've had some trouble with the initial substruct:db:bootstrap. A number of the column index names clashed. Easily fixed by renaming but rather tedious nontheless. Is this a known issue with rake 0.8.1, rails 2.0.2?
Regards, Nigel Pepper
I know this may seem like a simple question but where is the best place to unpack the tarball? Inside a rails_app directory already set up using rails or by itself? What is the directory structure to look like. Is vendor overlaid in the existing rails_app structure (in instantrails) or in its own standalone directory? A bit confused on this point of installation.
The rake substruct:db:bootstrap is breaking up on my Debian system and seems to give a strange error. I am pasting the command line output here, what could have happened??
Checking requirements... Initializing database... rake aborted! wrong number of arguments (1 for 0)
(See full trace by running task with --trace)
Trace Run shows the following:
rake aborted! wrong number of arguments (1 for 0) /home/safew/Desktop/saurabh/substruct_rel_1-0-a2/vendor/plugins/substruct/tasks/substruct.rake:94:in `execute' /home/safew/Desktop/saurabh/substruct_rel_1-0-a2/vendor/plugins/substruct/tasks/substruct.rake:94 /home/safew/Desktop/saurabh/substruct_rel_1-0-a2/vendor/plugins/substruct/tasks/substruct.rake:89:in `each' /home/safew/Desktop/saurabh/substruct_rel_1-0-a2/vendor/plugins/substruct/tasks/substruct.rake:89 /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 localhost:/home/safew/Desktop/saurabh/substruct_rel_1-0-a2/vendor/plugin
sudo gem update rake to hasmukhathod
when running the
rake substruct:db:bootstrap
i get the following error:
(in /home/eof/sources/substruct_rel_1-0-a3) Checking requirements... Initializing database... WARNING? Mail server settings have not been initialized. Check to make sure they've been set in the admin panel. rake aborted! Access denied for user 'root'@'localhost' (using password: NO)
(See full trace by running task with --trace)
i fixed this by removing the password for mysql root. but for the life of me could not figure out how to just supply the password
Install works great (Ubuntu Server 7.10). I installed it using fcgid under Apache2. Is there any way to use a different DocumentRoot??? Say, for example, /catalog/. I got it working under /catalog/ only I had to change vendor/plugins/substruct/assets/stylesheets/.css with a:
This then fixes the display problems but all is not well with substruct. When I navigate to http://mysite.com/catalog/admin/ I can login but some links do not respect the new document root. Namely, the Orders button at the top of the admin menu. It tries to go to https://mysite.com/admin/orders. Also, changing the password of a user fails with:
Completed in 0.03238 (30 reqs/sec) | Rendering: 0.01832 (56%) | DB: 0.00000 (0%) | 200 OK https://mysite.com/catalog/admin/users/edit/1 /!\ FAILSAFE /!\ Mon May 05 08:42:49 -0700 2008 Status: 500 Internal Server Error undefined method `[]' for nil:NilClass? /home/user/substruct/vendor/rails/actionpack/lib/action_controller/request.rb:461:in `clean_up_ajax_request_body!' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/request.rb:380:in `parse_formatted_request_parameters' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:78:in `request_parameters' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/request.rb:287:in `parameters' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/request.rb:22:in `request_method' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/request.rb:35:in `method' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/routing.rb:1483:in `extract_request_environment' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/routing.rb:1424:in `recognize' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:170:in `handle_request' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi' /home/user/substruct/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch' /home/user/substruct/vendor/rails/railties/lib/fcgi_handler.rb:101:in `process_request' /home/user/substruct/vendor/rails/railties/lib/fcgi_handler.rb:149:in `with_signal_handler' /home/user/substruct/vendor/rails/railties/lib/fcgi_handler.rb:99:in `process_request' /home/user/substruct/vendor/rails/railties/lib/fcgi_handler.rb:77:in `process_each_request' /usr/lib/ruby/1.8/fcgi.rb:612:in `each_cgi' /usr/lib/ruby/1.8/fcgi.rb:609:in `each' /usr/lib/ruby/1.8/fcgi.rb:609:in `each_cgi' /home/user/substruct/vendor/rails/railties/lib/fcgi_handler.rb:76:in `process_each_request' /home/user/substruct/vendor/rails/railties/lib/fcgi_handler.rb:50:in `process!' /home/user/substruct/vendor/rails/railties/lib/fcgi_handler.rb:24:in `process!' /home/user/substruct/public/dispatch.fcgi:24 /!\ FAILSAFE /!\ Mon May 05 08:46:17 -0700 2008Oddly enough, adding a user does not fail. I tried to fix the DocumentRoot?? problem with a rewrite rule like so:
RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} ^.*/catalog/(.*)$ [NC] RewriteRule ^(.*)/(.*) $1/catalog/$2 [F]But this gives a 403 Forbidden with no message in the error log or the Rails log!
I wanted to emphasize that everything works great when run through WEBrick. I would put substruct in / on the server, except my SSL cert is for the main domain and I have Radiance installed under fcgid in the DocumentRoot?? of the main server.
What am I doing wrong? Is this not possible to setup under fcgid?
Got it! I RTFM'ed the mod_rewrite docs and wrote this, which fixes all problems including the nil:NilClass? exception when changing user passwords:
RewriteEngine On RewriteCond %{REQUEST_URI} !^/catalog.*$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} ^.*/catalog/.*$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /catalog/dispatch.fcgi [QSA,L] RewriteCond %{REQUEST_URI} !^/catalog.*$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} ^.*/catalog/.*$ [NC] RewriteRule ^(.*)$ /catalog/$1 [QSA,L] RewriteCond %{REQUEST_URI} !^/catalog.*$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] RewriteCond %{REQUEST_URI} ^/catalog.*$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /catalog/dispatch.fcgi [QSA,L]This allows a RoR app on / and Substruct at /catalog under fcgid or fastcgi. In this case I've got Radiance installed in / and it works great!
Note you'll also want to install imagemagick convert command? along with mini_magick well be listed as a pre-requisite?.
Can anyone please help. When I try to open wishlist i get this response on firefox it is not working.
SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)
The page you are trying to view can not be shown because the authenticity of the received data could not be verified.
What can be wrong ?? I dont think it is application error as my application is working on a different server and my development servers.
@jagdeepkh: I believe you need to have your secure certificate in place before you'll be able to access the admin section in production mode.
Hi patrickberkeley,
I have the same problem with jagdeepkh, can you help to explain more on your solution?
Regards, Dinh Hai.
Nguyendinhhai/Jagdeepkh -- I'm also running into the same problem in production. I've got an SSL cert in place, but I still can't access those parts of the store (Admin, Wishlist, Login, etc).
Is there a setting somewhere that needs to be changed? It works fine in development, but my production enviornment on the server can't seem to find the resource, with http:// or https://
Any info will help
my method:
modify: vendor/plugins/substruct/lib/substruct.rb set: self.override_ssl_production_mode = false
If you get error like: no such file to load: tmail/version
then you will need to install TMail:
gem install tmail
can this thing work with sqlite? i tried to use sqlite3 but got some error about some index being created which already existed. Is there some code/sql which cant be executed on sqlite?
rake aborted! no such file to load -- /mnt/srv/webapps/rails/substruct6/config/../lib/mephisto/plugin
I am getting an error for Mephisto when I try to run substruct.
--does this make any sense to anyone?
I am confused.
re: sqlite http://betterlogic.com/roger/?p=367
For NGINX users running in PRODUCTION mode. You need to add the following line:
proxy_set_header X-FORWARDED_PROTO https;
In your virtualhost config for the server listing on 443 within the "location /" block.
Otherwise you get an error like:
Filter chain halted as :ssl_required? rendered_or_redirected.
I suffer this problem when I use command rake substruct:db:bootstrap
rake aborted! can't activate activesupport (= 2.1.1, runtime), already activated activesupport -2.1.0 C:/rubydev/substruct_rel_1-0-a6/rakefile:10 (See full trace by running task with --trace)
please post your question to the substruct group. Thanks! make sure environment.rb has version 2.1.0, make sure you have that version in vendor/rails, and, if necessary gem uninstall version 2.1.1?
none of the graphics show up. I followed the instructions.... It just looks like a rough unrefined html page without styling, or graphics. Any guesses as to the problem?
is that just how it looks out of the box before installing your own templates?
Are there quick instructions on making it look presentable? Based on the instructions here: http://code.google.com/p/substruct/wiki/Customizing it seems it wont look presentable without a lot of fiddling. Is this correct?
the graphics should show up look just like http://substruct.subimage.com/ ? -- make sure you're running it from the 'root' directory / shows the start page?. Feel free to post questions to the substruct group. redcloth you may have to try --version 3.0.4 Cheers. -=R
http://code.google.com/p/substruct/issues/detail?id=148 might help.
hi, i want to import 20, 000 products, can i do this with substruct? , thanks
Hi I'm getting that error the first time I start my server:
Attempting to copy plugin assets from 'C:/NetBeansProjects?/substructCrystal/vend or/plugins/substruct/assets' to 'C:/NetBeansProjects?/substructCrystal/public/plu gin_assets' WARNING: Couldn't create the public file structure for plugin 'substruct'; Error
Invalid argument - C:/NetBeansProjects?/substructCrystal/public/plugin_assets/sub struct/C: checking plugin 'engines' for 'application_helper' checking plugin 'active_merchant' for 'application_helper' checking plugin 'acts_as_tree' for 'application_helper' checking plugin 'ar_fixtures' for 'application_helper' checking plugin 'attachment_fu' for 'application_helper' checking plugin 'attachment_fu_fixtures' for 'application_helper' checking plugin 'substruct' for 'application_helper' ==> loading from plugin 'substruct' checking plugin 'will_paginate' for 'application_helper' (file not found in application) checking plugin 'engines' for 'substruct_application_controller' checking plugin 'active_merchant' for 'substruct_application_controller' checking plugin 'acts_as_tree' for 'substruct_application_controller' checking plugin 'ar_fixtures' for 'substruct_application_controller' checking plugin 'attachment_fu' for 'substruct_application_controller' checking plugin 'attachment_fu_fixtures' for 'substruct_application_controller' checking plugin 'substruct' for 'substruct_application_controller' ==> loading from plugin 'substruct' checking plugin 'will_paginate' for 'substruct_application_controller' (file not found in application) loading routes from C:/NetBeansProjects?/substructCrystal/vendor/plugins/substruc t/routes.rb `←[0m ERE (preferences.name = 'use_smtp_tls_patch') LIMIT 1←[0m E (preferences.name = 'mail_host') LIMIT 1←[0m ERE (preferences.name = 'mail_port') LIMIT 1←[0m E (preferences.name = 'mail_auth_type') LIMIT 1←[0mCould someone help please
Thanks
please see the group. Thanks! I'll let you off this time, though. See issue 148 .
Am having real difficulty getting the database schema to create when running 'rake substruct:db:bootstrap', error ...
Mysql::Error: Specified key was too long; max key length is 767 bytes: CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations (version)
Am trying to create the index manually which perhaps will help, anyone got any better ideas?
Thanks
Richard.
im having my rest-full rails application, i just put the substruct folder in vendor/plugins. now, my problem is to redirect the application when url is localhost:XXXX/admin, it is not working fine... any help..
i found out that the substruct is not rest-full....i hope...
Please guide me, if i am wrong....
hi, i just finished the installation and i get this error,
fede@fede-laptop:~/Desktop/principal/downloads/substruct$ ruby script/server => Booting lighttpd (use 'script/server webrick' to force WEBrick) => Rails 2.1.0 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server (see config/lighttpd.conf for options) Exiting Couldn't find any pid file in '/home/fede/Desktop/principal/downloads/substruct/tmp/pids' matching 'dispatch.0-9?.pid' (also looked for processes matching "/home/fede/Desktop/principal/downloads/substruct/public/dispatch.fcgi")
any ideas what im doing wrong? thanks.
maybe try it with script/server webrick?
hi there, i get this error when i run rake 'substruct:db:bootstrap'...
rake aborted! development database is not configured
what seems to be the problem here?