Akshay Rawat 's post that refers to a video where all of my worries are presented along the reasons why I havent done much more than design and prototypes apps with document based DB and never in production.
Well i have had the same problems she is talking about at the design face, i have never implemented document base db because of all she said. Still i think things are changing because most node.s projects use mongodb and node.js's community is growing very fast.
You are both right and wrong. Redis is a memory-only key-value store, but you are free to specify dump intervals in your redis config where it saves its contents to disk. Check the docs for more.
Fyi, the mongoid_ancestry gem provides nearly the same feature set as the ancestry gem for active_record, but for mongoid. It has some gotchas but worth to check out.
However, there's been more out-of-the-box support for mongoid among popular authentication gems... If you want to introduce that type of logic with MongoMapper while doing very little typing in your text editor and still watch it all work, I recommend checking out Sorcery as a starting point. Sorcery jives with MongoMapper way better than things like Clearance or Devise. Obviously there's a gem for that but we've lost track of the the point here, because the real question we ought to consider is the extent ORMs are appropriate for engaging NoSQL data structures from Ruby. Maybe I'm missing something but it's tough for me to distinguish the key value store pattern from array or the ruby hash key/entry. Isn't MongoDB's driver the most natural map to data objects we handle in ruby? I tell you all, if it weren't for free validation methods and some active model hooks I wouldn't be able to care about Mongo ORMs.
Hey guys, I have followed the instructions to the line.. I got to here;
deployer@ve:~$ rbenv install 1.9.3-p125
Shell Output
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20120728204839.7741
Results logged to /tmp/ruby-build.20120728204839.7741.log
Last 10 log lines:
yaml-0.1.4/win32/vs2008/run_parser.vcproj
yaml-0.1.4/win32/vs2008/yaml.vcproj
yaml-0.1.4/win32/vs2008/test_version.vcproj
yaml-0.1.4/win32/vs2008/run_emitter.vcproj
yaml-0.1.4/win32/vs2008/example_reformatter.vcproj
yaml-0.1.4/win32/vs2008/run_loader.vcproj
yaml-0.1.4/win32/vs2008/yamldll.vcproj
yaml-0.1.4/win32/config.h
/tmp/ruby-build.20120728204839.7741/yaml-0.1.4 /tmp/ruby-build.20120728204839.7741 ~
/home/deployer/.rbenv/plugins/ruby-build/bin/ruby-build: ./configure: /bin/sh: bad interpreter: Permission denied
This is horrendous - by the time you had written all the regex's for every bit of your code you could have written tests by hand much quicker. It is like you are making up regex'sa to explain english statements instead of logically doing something - seems really convoluted to me.
Am I not getting something? I was checking all over to see if this was a practical joke or something.
I followed the tutorial and got fb-connect working with localhost:3000. I am using version 1.4.0 as suggested in the comment above and am not using javascript popup. Now, when I uploaded my work on development server and click "sign in with facebook", I get
No route matches [GET] "/auth/facebook"
The only difference between localhost and dev server is the app on dev server has dev.mydomain.com:3000 as its domain and that's the domain I entered on fb app setting page. Is having a subdomain the problem? Any help would be appreciated.
Here are gems on both my localhost and dev server. Thanks!
Using oauth2 (0.8.0)
Using omniauth (1.1.0)
Using omniauth-oauth2 (1.0.3)
Using omniauth-facebook (1.4.0)
What would be the case if I dont want to specify the gender array in the /users/show.html.erb page as collection: [["Male", "Male"], ["Female", "Female"], ["", "Unspecified"]]
but rather define an array in the gender action inside the user class and reference it on show page?
def gender
['Male', 'Female']
end
and how to call these in the index using best_in_place syntax?
Fantastic Episode! I never knew that just by moving the position of the javascript tag in the Layout File you could accomplish so much! This is really useful! Thank you Mr. Bates
Just logged in to post this gotcha too, but then I saw your comment.
This should be added to rails guides and definitely to release notes or something...
Unfortunately, I couldn't ran this on my Project:
gems/rack-mini-profiler-0.1.7/lib/mini_profiler/storage/memory_store.rb:17:in block in initialize': private methodcleanup_cache' called for #Rack::MiniProfiler::MemoryStore:0x00000003bcb670 (NoMethodError)
I tried with FileStorage too:
gems/rack-mini-profiler-0.1.7/lib/mini_profiler/storage/file_store.rb:43:in block in initialize': undefined methodinstance' for Rack::MiniProfiler:Class (NoMethodError)
My project is running Rails 3.2.7 with ruby 1.9.3-p194
It would have helped a novice like me to know that I needed to restart the rails server before "When we reload the page now our table looks quite different."
Also, I saw two places where products.js is mentioned without the .coffee
@Sam
This is very promising. I am following Ryan's screencast and everything works fine on my dev machine, but I do not see the Profiler Tab in my production environment on my local machine. Is there something different in your local gem?
Thanks.
Bharat
I've been fighting with that one for a while now. That is the cry for help. As suggested I've going through all the commands and executed them on the remote server.
The command that fails on the server is:
It says: \n not found. As far as I can tell, it doesn't like the new lines. When I put them away manually - everything goes OK.
The interesting this is - the deployment script seem to execute this command OK, and it is the next one it stables upon (bundle install). Although when executing manually on the sever - bundles get installed OK.
What can it be? And how, and where, do I edit those new lines "\\n" out?
Complete Output:
λ config → λ git master → cap deploy:cold
* executing `deploy:cold'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:andremaha/blog.git master"
command finished in 4916ms
* executing "if [ -d /home/deployer/apps/blog/shared/cached-copy ]; then cd /home/deployer/apps/blog/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 6fb7914a0c09159399ce85f00073692c4cd32a8a && git clean -q -d -x -f; else git clone -q git@github.com:andremaha/blog.git /home/deployer/apps/blog/shared/cached-copy && cd /home/deployer/apps/blog/shared/cached-copy && git checkout -q -b deploy 6fb7914a0c09159399ce85f00073692c4cd32a8a; fi"
servers: ["50.112.249.58"]
[50.112.249.58] executing command
command finished in 12628ms
copying the cached version to /home/deployer/apps/blog/releases/20120726142915
* executing "cp -RPp /home/deployer/apps/blog/shared/cached-copy /home/deployer/apps/blog/releases/20120726142915 && (echo 6fb7914a0c09159399ce85f00073692c4cd32a8a > /home/deployer/apps/blog/releases/20120726142915/REVISION)"
servers: ["50.112.249.58"]
[50.112.249.58] executing command
command finished in 706ms
* executing `deploy:finalize_update'
triggering before callbacks for `deploy:finalize_update'
* executing `deploy:assets:symlink'
* executing "rm -rf /home/deployer/apps/blog/releases/20120726142915/public/assets &&\\\n mkdir -p /home/deployer/apps/blog/releases/20120726142915/public &&\\\n mkdir -p /home/deployer/apps/blog/shared/assets &&\\\n ln -s /home/deployer/apps/blog/shared/assets /home/deployer/apps/blog/releases/20120726142915/public/assets"
servers: ["50.112.249.58"]
[50.112.249.58] executing command
command finished in 693ms
* executing `bundle:install'
* executing "cd /home/deployer/apps/blog/releases/20120726142915 && bundle install --gemfile /home/deployer/apps/blog/releases/20120726142915/Gemfile --path /home/deployer/apps/blog/shared/bundle --deployment --quiet --without development test"
servers: ["50.112.249.58"]
[50.112.249.58] executing command
** [out :: 50.112.249.58] sh: 1:
** [out :: 50.112.249.58] bundle: not found
** [out :: 50.112.249.58]
command finished in 679ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/deployer/apps/blog/releases/20120726142915; true"
servers: ["50.112.249.58"]
[50.112.249.58] executing command
command finished in 683ms
failed: "sh -c 'cd /home/deployer/apps/blog/releases/20120726142915 && bundle install --gemfile /home/deployer/apps/blog/releases/20120726142915/Gemfile --path /home/deployer/apps/blog/shared/bundle --deployment --quiet --without development test'" on 50.112.249.58
Akshay Rawat 's post that refers to a video where all of my worries are presented along the reasons why I havent done much more than design and prototypes apps with document based DB and never in production.
Well i have had the same problems she is talking about at the design face, i have never implemented document base db because of all she said. Still i think things are changing because most node.s projects use mongodb and node.js's community is growing very fast.
Subscribed just for this episode so I do this the best way. Thanks!
An interesting talk at RubyConf on why Diaspora went from MongoDB to MySQL.
You are both right and wrong. Redis is a memory-only key-value store, but you are free to specify dump intervals in your redis config where it saves its contents to disk. Check the docs for more.
Fyi, the mongoid_ancestry gem provides nearly the same feature set as the ancestry gem for active_record, but for mongoid. It has some gotchas but worth to check out.
However, there's been more out-of-the-box support for mongoid among popular authentication gems... If you want to introduce that type of logic with MongoMapper while doing very little typing in your text editor and still watch it all work, I recommend checking out Sorcery as a starting point. Sorcery jives with MongoMapper way better than things like Clearance or Devise. Obviously there's a gem for that but we've lost track of the the point here, because the real question we ought to consider is the extent ORMs are appropriate for engaging NoSQL data structures from Ruby. Maybe I'm missing something but it's tough for me to distinguish the key value store pattern from array or the ruby hash key/entry. Isn't MongoDB's driver the most natural map to data objects we handle in ruby? I tell you all, if it weren't for free validation methods and some active model hooks I wouldn't be able to care about Mongo ORMs.
Radha, check out my 2nd favorite ORM in the world: MongoMapper! 2nd only to Active Record! :)
The VPS I'm using is Media Template. Apparently they mount /tmp with noexec.. To resolve this;
then go back and run rbenv install 1.9.3-p125 again.
Once done, just umount and reboot for it to put /tmp back as a noexec..
I tried to remove the noexec and remount but it wouldn't let me.. shrug
Hey guys, I have followed the instructions to the line.. I got to here;
deployer@ve:~$ rbenv install 1.9.3-p125
... little help?
Thanks Ryan great episode as always.
What i find a bit hard to implement in document base DB are trees and has_many through associations.
In wich differs the revised episode from this one? I might do my first subscription purchase if you give a good reason :)
btw, thanks for all these screencasts, you are awesome Mr. Ryan Bates!
i'm trying to render a partial form in a show view but it doesn't render it, do you know why would this be?
do you happen to have the mysql gem as well in your gem file?
I may be confused on the Twitter Secret & Consumer keys... but should these values be stored in a hash?
In the unfortunate event of a database being hacked - wouldn't that give access to post on user's Twitter accounts?
This is horrendous - by the time you had written all the regex's for every bit of your code you could have written tests by hand much quicker. It is like you are making up regex'sa to explain english statements instead of logically doing something - seems really convoluted to me.
Am I not getting something? I was checking all over to see if this was a practical joke or something.
Hello everyone,
I followed the tutorial and got fb-connect working with localhost:3000. I am using version 1.4.0 as suggested in the comment above and am not using javascript popup. Now, when I uploaded my work on development server and click "sign in with facebook", I get
No route matches [GET] "/auth/facebook"
The only difference between localhost and dev server is the app on dev server has dev.mydomain.com:3000 as its domain and that's the domain I entered on fb app setting page. Is having a subdomain the problem? Any help would be appreciated.
Here are gems on both my localhost and dev server. Thanks!
Using oauth2 (0.8.0)
Using omniauth (1.1.0)
Using omniauth-oauth2 (1.0.3)
Using omniauth-facebook (1.4.0)
rất hay
I'm not sure if I'm understanding your question correctly. You could call
@user.gender
in the view if you want to put the array in a method.me too, I'm using postgres
$ gem list pg
*** LOCAL GEMS ***
pg (0.14.0)
How I do fix that?
Hi Ryan, Indeed great screencast.
What would be the case if I dont want to specify the gender array in the
/users/show.html.erb page
ascollection: [["Male", "Male"], ["Female", "Female"], ["", "Unspecified"]]
but rather define an array in the gender action inside the user class and reference it on show page?
def gender
['Male', 'Female']
end
and how to call these in the index using best_in_place syntax?
Thanks,
yeah, that is not going to work, you are going to need to pull the whole tree
Fantastic Episode! I never knew that just by moving the position of the javascript tag in the Layout File you could accomplish so much! This is really useful! Thank you Mr. Bates
Just logged in to post this gotcha too, but then I saw your comment.
This should be added to rails guides and definitely to release notes or something...
had the same issue and was stuck for hours. issue is with font awesome, here's the solution: https://github.com/seyhunak/twitter-bootstrap-rails/issues/292
Unfortunately, I couldn't ran this on my Project:
gems/rack-mini-profiler-0.1.7/lib/mini_profiler/storage/memory_store.rb:17:in
block in initialize': private method
cleanup_cache' called for #Rack::MiniProfiler::MemoryStore:0x00000003bcb670 (NoMethodError)The line of this error:
https://github.com/SamSaffron/MiniProfiler/blob/master/Ruby/lib/mini_profiler/storage/memory_store.rb#L17
I tried with FileStorage too:
gems/rack-mini-profiler-0.1.7/lib/mini_profiler/storage/file_store.rb:43:in
block in initialize': undefined method
instance' for Rack::MiniProfiler:Class (NoMethodError)My project is running Rails 3.2.7 with ruby 1.9.3-p194
Hello Sam,
I use the latest github profiler.rb from miniprofiler, after that my error changed as follows
and the console is
How can i help you solving this problem? also thank you for your dealing..
thanks for that link, some excellent tips from that guy
can you try the latest from github to see if it fixes it?
at the moment there is no support for rack 1.2.5, I am going to see what is involved in backporting
I wonder if we could use multiple containers for pjax. so when a link in div 'one' has clicked, the content in the div 'two' loaded.
Here you are http://community.miniprofiler.com/permalinks/77/aborted-request-to-mini-profiler-resources-results
I installed miniprofiler as Ryan said. But, the miniprofiler don`t show itself in the index.
My Rails version is 3.0.15 and Ruby version is 1.9.2p180.
When running the rails with server mode, it gives me a
and the console log.
After that, i running the system from apache/passenger, but still, i couldn`t see the profiler in index, i see the index page source, it give me
Profiler, javascript code after the
</html>
tag..
So, i could not still see the profile.. bad.. so bad.
Is there a plan to support mongoid?
I use the Roo gem to import data in .xls files.
See http://roo.rubyforge.org/ -and- https://github.com/hmcgowan/roo
Came back here five years later to remind myself how to do this. Thanks Ryan. Thank you very much
Has anyone successfully integrated individual column filtering (preferably with multiple columns) with a Rails back end?
Thanks a lot.
Many thanks. that did the trick. What an awesome tool!
Meaning declaring the model attributes with attr_accessible? If that is what you are asking, yes I am.
Try to clearing all browsing cache. It should work fine.
yes, please do, with any relevant logs!
it should work on both, are you whitelisting your requests?
I need to figure out a way to backport some of this to rack 1.2.5, at the moment it depends on a later rack
Great info, thank you.
It would have helped a novice like me to know that I needed to restart the rails server before "When we reload the page now our table looks quite different."
Also, I saw two places where products.js is mentioned without the .coffee
thanks daniel!
I wasn't aware that
was valid bundler syntax, I thought it was
:git
. Is there a difference between the two? I can't exactly google the issue due to white noise.Typo in ASCII-Cast
gsg-keypair.gem should be gsg-keypair.pem
@Sam
This is very promising. I am following Ryan's screencast and everything works fine on my dev machine, but I do not see the Profiler Tab in my production environment on my local machine. Is there something different in your local gem?
Thanks.
Bharat
Problem
I've been fighting with that one for a while now. That is the cry for help. As suggested I've going through all the commands and executed them on the remote server.
The command that fails on the server is:
It says: \n not found. As far as I can tell, it doesn't like the new lines. When I put them away manually - everything goes OK.
The interesting this is - the deployment script seem to execute this command OK, and it is the next one it stables upon (bundle install). Although when executing manually on the sever - bundles get installed OK.
What can it be? And how, and where, do I edit those new lines "\\n" out?
Complete Output:
Yes, I have the same problem, Rails 3.0.15, Ruby 1.9.3-p125, Rack 1.2.5