nesquena / sinatra_more Goto Github PK
View Code? Open in Web Editor NEWGenerators, helpers and extensions enabling complex sinatra apps
Home Page: http://padrinorb.com
License: MIT License
Generators, helpers and extensions enabling complex sinatra apps
Home Page: http://padrinorb.com
License: MIT License
I installed the gem and put it in my Gemfile but somehow I got this error. Below is how I called it.
<% form_for(@business_card, '/business_cards') do |f| %>
= javascript_include_tag 'jquery.json', :cache => false
results in
<script type="text/javascript" src="/javascripts/jqueryon.js?1259387744"></script>
I reckon this should just about fix it ( no tests, sorry):
http://github.com/davidlee/sinatra_more/commit/caf069e72bfc218e5621787eb05d51662ab6d43a
at sinatra_more-0.3.29/lib/sinatra_more/markup_plugin/tag_helpers.rb: in tag, line 29
Hey,
Real excited to start using this but when I tried installing it, I had to install everything it was dependent on which doesn't seem right:
activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': no such file to load -- warden (MissingSourceFile)
sudo gem install warden...
activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': no such file to load -- actionmailer (MissingSourceFile)
sudo gem install actionmailer...
Any ideas?
sinatra_gen Deneme_App . -r haml -b
generating with haml renderer giving this error. no errors with standart generating.
DEPRECATION WARNING: require "actionmailer" is deprecated and will be removed in Rails 3. Use require "action_mailer" instead.. (called from <top (required)> at /usr/lib/ruby/gems/1.9.1/gems/actionmailer-2.3.5/lib/actionmailer.rb:2)
/home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in load_missing_constant': uninitialized constant SasInitializer (NameError) from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
const_missing_with_dependencies'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in const_missing' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:372:in
const_get'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:372:in block in constantize' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:371:in
each'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:371:in constantize' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in
constantize'
from /home/slmn/projects/Deneme_App/config/dependencies.rb:25:in block in <class:DenemeApp>' from /home/slmn/projects/Deneme_App/config/dependencies.rb:21:in
each'
from /home/slmn/projects/Deneme_App/config/dependencies.rb:21:in <class:DenemeApp>' from /home/slmn/projects/Deneme_App/config/dependencies.rb:7:in
<top (required)>'
from /home/slmn/projects/Deneme_App/config/boot.rb:41:in require' from /home/slmn/projects/Deneme_App/config/boot.rb:41:in
class:DenemeApp'
from /home/slmn/projects/Deneme_App/config/boot.rb:20:in <top (required)>' from config.ru:4:in
require'
from config.ru:4:in block in <top (required)>' from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/lib/rack/builder.rb:29:in
instance_eval'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/lib/rack/builder.rb:29:in initialize' from config.ru:1:in
new'
from config.ru:1:in <top (required)>' from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/bin/rackup:103:in
eval'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/bin/rackup:103:in <top (required)>' from bin/rackup:3:in
load'
from bin/rackup:3:in <main>' /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in
load_missing_constant': uninitialized constant SasInitializer (NameError)
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in const_missing_with_dependencies' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
const_missing'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:372:in const_get' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:372:in
block in constantize'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:371:in each' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:371:in
constantize'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in constantize' from /home/slmn/projects/Deneme_App/config/dependencies.rb:25:in
block in class:DenemeApp'
from /home/slmn/projects/Deneme_App/config/dependencies.rb:21:in each' from /home/slmn/projects/Deneme_App/config/dependencies.rb:21:in
class:DenemeApp'
from /home/slmn/projects/Deneme_App/config/dependencies.rb:7:in <top (required)>' from /home/slmn/projects/Deneme_App/config/boot.rb:41:in
require'
from /home/slmn/projects/Deneme_App/config/boot.rb:41:in <class:DenemeApp>' from /home/slmn/projects/Deneme_App/config/boot.rb:20:in
<top (required)>'
from config.ru:4:in require' from config.ru:4:in
block in <top (required)>'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/lib/rack/builder.rb:29:in instance_eval' from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/lib/rack/builder.rb:29:in
initialize'
from config.ru:1:in new' from config.ru:1:in
<top (required)>'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/bin/rackup:103:in eval' from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/bin/rackup:103:in
<top (required)>'
from bin/rackup:3:in load' from bin/rackup:3:in
I'm trying to run:
sinatra_gen apartment . -r=haml -b
and getting the next error:
/Library/Ruby/Gems/1.8/gems/sinatra_more-0.3.40/bin/../generators/skeleton_generator.rb:33:in setup_skeleton': undefined method
classify' for "apartment":String (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/task.rb:22:in send' from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/task.rb:22:in
run'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:118:in invoke_task' from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:124:in
invoke_all'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/shell.rb:14:in map' from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/core_ext/ordered_hash.rb:73:in
each'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:124:in map' from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/invocation.rb:124:in
invoke_all'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/group.rb:226:in dispatch' from /Library/Ruby/Gems/1.8/gems/thor-0.14.3/lib/thor/base.rb:389:in
start'
from /Library/Ruby/Gems/1.8/gems/sinatra_more-0.3.40/bin/sinatra_gen:6
from /usr/bin/sinatra_gen:19:in `load'
from /usr/bin/sinatra_gen:19
I was stuck for a couple of hours trying to figure out why the Rack::Auth::Basic module would just not work correctly on my site until I finally figured out that it was due to some conflict between Rack's auth request object and sinatra_more's Warden plugin. Arguably, one could say to just use the Warden plugin instead, but I just wanted to publish this issue so the author could know about it, and perhaps other people having the same issue can find it.
The sinatra_gen fails for me. Am I missing something?
This is on a bitnami ruby stack on winxp:
C:\Documents and Settings\aandree\BitNami RubyStack projects\sinatra\prefcenter>sinatra_gen pref_center . -t=bacon -r=haml -s=jquery -orm=datamapper
C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/sinatra_more-0.3.40/bin/../generators/skeleton_generator.rb:33:in `setup_skeleton': undefined method `classify' for "pref_center":String (NoMethodError)
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/task.rb:33:in `send'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/task.rb:33:in `run'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/invocation.rb:109:in `invoke'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/shell.rb:12:in `map'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/core_ext/ordered_hash.rb:73:in `each'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/invocation.rb:118:in `map'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/invocation.rb:118:in `invoke'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/group.rb:36:in `start'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/base.rb:378:in `start'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/thor-0.13.7/lib/thor/group.rb:29:in `start'
from C:/Files/RubyStack/ruby/lib/ruby/gems/1.8/gems/sinatra_more-0.3.40/bin/sinatra_gen:6
from C:/Files/RubyStack/ruby/bin/sinatra_gen:19:in `load'
from C:/Files/RubyStack/ruby/bin/sinatra_gen:19
Hello, i really like this gem and i think is awesome.
I am interested if there are any plans in adding support for sprockets ? That would be even more awesome.
Thank you very much.
hi again,
before last line in file ./vendor/gems/gems/haml-2.2.16/lib/sass/plugin.rb trying to load
require 'sass/plugin/rails' if defined?(ActionController)
and getting this error. if you "#" it no problem to load with "haml" support.
DEPRECATION WARNING: require "actionmailer" is deprecated and will be removed in Rails 3. Use require "action_mailer" instead.. (called from <top (required)> at /usr/lib/ruby/gems/1.9.1/gems/actionmailer-2.3.5/lib/actionmailer.rb:2)
/home/slmn/projects/Deneme_App/vendor/gems/gems/haml-2.2.16/lib/sass/plugin/rails.rb:4:in <top (required)>': undefined method
+' for nil:NilClass (NoMethodError)
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
block in require'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
require'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/haml-2.2.16/lib/sass/plugin.rb:224:in <top (required)>' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
require'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in block in require' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
new_constants_in'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' from /home/slmn/projects/Deneme_App/vendor/gems/gems/haml-2.2.16/lib/sass/plugin/rack.rb:1:in
<top (required)>'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
block in require'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
require'
from /home/slmn/projects/Deneme_App/config/initializers/sass.rb:6:in registered' from /home/slmn/projects/Deneme_App/vendor/gems/gems/sinatra-0.9.4/lib/sinatra/base.rb:838:in
block in register'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/sinatra-0.9.4/lib/sinatra/base.rb:836:in each' from /home/slmn/projects/Deneme_App/vendor/gems/gems/sinatra-0.9.4/lib/sinatra/base.rb:836:in
register'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/sinatra-0.9.4/lib/sinatra/base.rb:1062:in register' from /home/slmn/projects/Deneme_App/config/dependencies.rb:24:in
block in class:DenemeApp'
from /home/slmn/projects/Deneme_App/config/dependencies.rb:20:in each' from /home/slmn/projects/Deneme_App/config/dependencies.rb:20:in
class:DenemeApp'
from /home/slmn/projects/Deneme_App/config/dependencies.rb:7:in <top (required)>' from /home/slmn/projects/Deneme_App/config/boot.rb:41:in
require'
from /home/slmn/projects/Deneme_App/config/boot.rb:41:in <class:DenemeApp>' from /home/slmn/projects/Deneme_App/config/boot.rb:20:in
<top (required)>'
from config.ru:3:in require' from config.ru:3:in
block in <top (required)>'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/lib/rack/builder.rb:29:in instance_eval' from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/lib/rack/builder.rb:29:in
initialize'
from config.ru:1:in new' from config.ru:1:in
<top (required)>'
from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/bin/rackup:103:in eval' from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/bin/rackup:103:in
<top (required)>'
from bin/rackup:3:in load' from bin/rackup:3:in
<top (required)>': undefined method
+' for nil:NilClass (NoMethodError)require' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
block in require'new_constants_in' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
require'<top (required)>' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
require'block in require' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
new_constants_in'require' from /home/slmn/projects/Deneme_App/vendor/gems/gems/haml-2.2.16/lib/sass/plugin/rack.rb:1:in
<top (required)>'require' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
block in require'new_constants_in' from /home/slmn/projects/Deneme_App/vendor/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
require'registered' from /home/slmn/projects/Deneme_App/vendor/gems/gems/sinatra-0.9.4/lib/sinatra/base.rb:838:in
block in register'each' from /home/slmn/projects/Deneme_App/vendor/gems/gems/sinatra-0.9.4/lib/sinatra/base.rb:836:in
register'register' from /home/slmn/projects/Deneme_App/config/dependencies.rb:24:in
block in class:DenemeApp'each' from /home/slmn/projects/Deneme_App/config/dependencies.rb:20:in
class:DenemeApp'<top (required)>' from /home/slmn/projects/Deneme_App/config/boot.rb:41:in
require'<class:DenemeApp>' from /home/slmn/projects/Deneme_App/config/boot.rb:20:in
<top (required)>'require' from config.ru:3:in
block in <top (required)>'instance_eval' from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/lib/rack/builder.rb:29:in
initialize'new' from config.ru:1:in
<top (required)>'eval' from /home/slmn/projects/Deneme_App/vendor/gems/gems/rack-1.0.1/bin/rackup:103:in
<top (required)>'load' from bin/rackup:3:in
'This happens when trying to require sinatra_more/markup_plugin when you have activesupport-2.3.5, here's a quick stack trace:
FAIL
NameError: uninitialized constant ActiveSupport::Deprecation
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/blank.rb:2
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
/usr/local/lib/ruby/gems/1.8/gems/sinatra_more-0.3.4/lib/sinatra_more/support_lite.rb:5
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
/usr/local/lib/ruby/gems/1.8/gems/sinatra_more-0.3.4/lib/sinatra_more/markup_plugin.rb:1
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
require'
./lib/wewatchwecall.rb:6
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
config.ru:3:in `inner_app'
I keep getting the following error when trying to run the Sinatra generator command:
DEPRECATION WARNING: require "activesupport" is deprecated and will be removed in Rails 3. Use require "active_support" instead.. (called from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/activesupport.rb:2)
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in const_missing': uninitialized constant Thor::Group (NameError) from /Library/Ruby/Gems/1.8/gems/sinatra_more-0.3.33/bin/../generators/skeleton_generator.rb:6 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
require'
from /Library/Ruby/Gems/1.8/gems/sinatra_more-0.3.33/bin/sinatra_gen:4
from /usr/bin/sinatra_gen:19:in `load'
from /usr/bin/sinatra_gen:19
Something about a missing constant?
`const_missing': uninitialized constant Thor::Group (NameError)
When I run rackup, I get this issue
Bundler must be run to resolve dependencies!
Calculating dependencies...
Updating source: http://gemcutter.org
Could not find gem 'spec (>= 0, runtime)' in any of the sources
Retrying with dependencies resolved...
Bundler must be run to resolve dependencies!
Calculating dependencies...
Updating source: http://gemcutter.org
Could not find gem 'spec (>= 0, runtime)' in any of the sources
Retrying with dependencies resolved...
This goes on indefinitely until I force-quit it by logging out the session or kill -9. It seems like changing the Gemfile from
gem 'spec', :only => :testing
to
gem 'rspec', :only => :testing
Solves the problem.
When using erubis (v 2.6.6 for me) the #form_for helper causes templates to render several times within the same layout.
It's `require':
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.