Thanks for the screencast Ryan :-). I also have validations set up, however, on error the child model errors are displayed first, instead of the parent's. Since the parent fields are the first to show up, those errors should be displayed first. any ideas on what I could be doing wrong? Thanks again.
I have a question regarding how to save the search model that contains a field with multiple checkboxes: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/50915dfb233d62bc#
ryan,
the video's sweet and it's convinced me to try out whenever on my ubuntu 8.04 hardy server.
Anyway, I installed the gem using sudo and the installation went well.
Nevertheless, it's not so sweet now as the 3rd cron entry to remove items off the app's tmp/cache doesn't work.
It's got some issues with RAILS_ROOT not being set despite the fact that I have even set the path
(ie set :path, "<location of my app>").
Now , when I run "whenever", this is what I got.
barney_dinasour@evolutionct9a:~/projects/myApp$ whenever
/usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:20:in `initialize': /usr/local/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:105:in
`const_missing': uninitialized constant Whenever::JobList::RAILS_ROOT
(NameError)
from (eval):12:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:37:in `every'
from (eval):11:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `eval'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:20:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `cron'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
command_line.rb:31:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
command_line.rb:5:in `execute'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/bin/whenever:
30
from /usr/local/bin/whenever:19:in `load'
from /usr/local/bin/whenever:19
barney_dinasour@evolutionct9a:~/projects/myApp$
My configuration:
----------------------
* gem version is 1.3.5
* rails 2.3.5
* Ubuntu Hardy 8.04
@steve, thank you for this info, I was pretty sure the china's great firewall do not block gems.rubyforge.org, but the fact is I only cannot access this one. In my browser I cannot open http://gems.rubyforge.org/yaml if I don't use a proxy. No problem with others gem website.
@bryan, thank you for the github link. But I still I have a problem :
I downloaded sources then build and install every packages (actionpack, activerecord, etc...), then rails rails-3.0.0.beta1. Everything seems ok, but when I run my app with rails server, it says it cannot find rails sources in gems dir. And after checking I cannot find sources in rails-3.0.0.beta1 gem dir. So maybe I did something wrong during installation.
Another question, what's the best place at the moment to talk about rails 3 install problem ?
ryan,
the video's sweet and it's convinced me to try out whenever on my ubuntu 8.04 hardy server.
Nevertheless, it's not so sweet now cause I cannot run "whenever".
Anyway, I installed the gem using sudo and the installation went well.
Now , when I run "whenever", this is what I got.
barney_dinasour@evolutionct9a:~/projects/myApp$ whenever
/usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:20:in `initialize': /usr/local/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:105:in
`const_missing': uninitialized constant Whenever::JobList::RAILS_ROOT
(NameError)
from (eval):12:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:37:in `every'
from (eval):11:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `eval'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:20:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `cron'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
command_line.rb:31:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
command_line.rb:5:in `execute'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/bin/whenever:
30
from /usr/local/bin/whenever:19:in `load'
from /usr/local/bin/whenever:19
barney_dinasour@evolutionct9a:~/projects/myApp$
My configuration:
----------------------
* gem version is 1.3.5
* rails 2.3.5
* Ubuntu Hardy 8.04
I know that validations aren't dealt with here... as far as I can tell they _just work_, with one issue: if a nested record has been removed and the form submission fails validation, that record will be visible again (although it will still be deleted when the valid form is submitted).
I think this is simply because we need a javascript function to run when the body loads which checks for any hidden delete fields with a value of 1 and hides the associated row. Can anyone conjure up the appropriate javascript? Thanks.
Thx for this nice screencast!
I like the JQTouch Interface Plugin with Themes. Is there a similar solution for standard web apps? I mean a comparable css theme that makes developing Web-GUIs easier by suppling nice features like buttons and so on?
Is there something you can recommend?
@Alex, @Ryan, @Juan, @Frederic:
I have managed to separate caches for mobile and normal browsers. I do most of the work in .htaccess fils. So you should serve your application under Apache. The solution is super easy. You can review it at
http://www.badrit.com/blog/2010/2/2/keeping-separate-caches-for-mobile-browsers
--
Ahmed ElDawy
www.badrit.com
For those wondering about Ruby 1.9.1 vs 1.9.2. Rails 3 does support Ruby 1.9.1 but recommends 1.9.2. Since the latter is not yet released and I had some difficulties with it, I am showing 1.9.1 here.
@steve, right, I ran into the rack-mount dependency issue this morning as well. It will be fixed soon by a new release of Rails 3 beta gem.
@fred zingg
For what it's worth, I'm in China too and have no problem accessing ruby gems from the command line without a proxy. Youtube, Vimeo, and Danwei, on the other hand...
If anyone has any hang-ups with rack-mount, this is my experience:
gem install rack-mount now installs version 0.5.0 instead of 0.4.5... not sure why that should be a problem, but when i tried to install rails --pre, i got this:
I don't think rvm contributed to these problems, but i got this error after installing 1.8.7-p248 with rvm (I had installed p249 but that gave some errors when trying to install any version of Rails, so I reverted to p248 after reading that had fixed someone's problems with Rails 3). Now I still get segfaults for gem installs sometimes, then they work for no apparent reason the next time I try. That seems to be a minor issue with rvm that I can live with.
I noticed that this screencast worked with rack-mount 0.4.5. So, after uninstalling rack-mount, I tried:
gem install rack-mount --version=0.4.5
This worked the second time (after a segfault the first time).
Then I tried once more:
gem install rails --pre
And after waiting a few minutes with nothing happening...
Michael Thanks! I was able to get the pagination.js into the page header using the call
<script src="/javascripts/pagination.js" type="text/javascript">
</script>. Does anyone now why <% javascript "pagination" %> defined in the rails cast didn't work for me? It didn't fail, but it didn't list the jscript library in my header either. I wasn't using index.html.erb as my file name. Could this be why?
hello, GREAT tutorial.
I've got about half way though, where i need to test the invitaiton, and invite count decrements as expected. It handles missing email field, but when I enter an email address that is not listed already, I get:
undefined method `generate_token' for #<Invitation:0x2563bf8>
The invitation_controller has this:
@invitation.sender = @user
i used @user and user but bith return the same issue.
#200, yey! Ryan, I think you should give some badges, images or buttons, etc, so more people help you promote the "Give back to open source" campaign in their sites!
I installed rvm, ruby-19.1 and all rubygems (tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n) without any trouble.
But when I want to install rails 3 I got this issue below.
(I'm using a proxy because i'm living in China and I cannot access directly to http://gems.rubyforge.org/ from few months. So usually when I install a new gem, i use a proxy or I download directly the gem from the web)
the trace :
Exception `Gem::Package::FormatError' at /home/Acer-fredo/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:110 - No metadata found!
Exception `Gem::InstallError' at /home/Acer-fredo/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:121 - invalid gem format for /home/Acer-fredo/.rvm/gems/ruby-1.9.1-p378/cache/activesupport-3.0.0.beta.gem
ERROR: Error installing rails:
invalid gem format for /home/Acer-fredo/.rvm/gems/ruby-1.9.1-p378/cache/activesupport-3.0.0.beta.gem
Probably it comes from my proxy problem, but i'm not sure.
Do you have an idea or do you know where I can directly download rails-3.0.0 gems ?
Thank you very much for your dedication to these wonderful screen casts. My little team has started developing apps(for the group companies we work for) with Ruby on Rails for a month, and the speed and the joy just went up by huge amount.
When we face a challenge, we prefer railscast than book, because it's well explained, and very practical. And it works!
Also, related to the load of output and bundler error one may see when running rails commands inside a rails application, it's likely to be related to bundler.
There are some instructions about how to get rid of them:
http://www.ozmox.com/2010/02/07/fixing-rails-3-beta-invalid-gemspec-format-errors/
The proposed fix and some variants of it have made their ways into several bundler forks on github, so one may expect to install a new release of bundler soon I guess :)
Hello - just in case anyone else working on a mobile app ran into the same problem I did where your dev env creates asset URLs with "http://localhost:3000/" (see comment #29) - here's how I got around the issue:
I added the following to my config/environments/development.rb:
config.after_initialize do
ActionController::Base.asset_host = ''
end
Great screencast!
I was able to immediately apply it to a project I'm working on, and get a pretty complicated story done quickly.
(Unfortunately I didn't see some of the recent forks, and ended up doing the unobtrusive jquery stuff myself)
What is the best way to test the helper methods?
I would like to keep our code coverage up, and assert that the js escaping and new_record ids are being assigned, and I tend to test helper methods explicitly, but in this case I'm not sure how to test the 'link_to_add_fields' method, which calls out to the render method.
Has anyone else added tests for these methods? (hopefully I'm missing something obvious)
thanks!
Is it alright to use sudo before gem install/upgrade, provided I'm using the version of ruby I had prior to using rvm? Without it, it installs gems in ~/.gem.
@George, if you are using rvm as I show in this episode you can simply switch back to your older version of Ruby and it will use the older version of Rails.
Also specifying the rails version in your config/environment.rb (for 2.3 projects) will work so you can easily juggle multiple Rails apps with multiple versions.
@Nicholas, thanks for the link on fixing the stderr output!
@Hussein, thanks for the corrections and update! It is good to know 1.9.2 is receiving more focus.
Jeremy Kemper said:
Rails 3 will definitely prefer Ruby 1.9.2.
If you’re running 1.9, I’d recommend building 1.9.2dev rather than using 1.9.1. It’s big upgrade, it has quite a few behavior changes, and Rails master is developed against 1.9.2 exclusively (though we do continuous integration against 1.9.1 for good measure).
The key to *requiring* 1.9.2 is full mysql-ruby, pg, and sqlite3-ruby encoding support. These database drivers have had ages to upgrade but still aren’t up to snuff. Pitch in, make it happen, and you’ll find the database-backed web app world one step behind you.
All the junk in the stderr output in the terminal is a known issue (it's not for debugging). You can get rid of it if you follow the direction here: http://bit.ly/bNiLrS
Thanks for the screencast Ryan :-). I also have validations set up, however, on error the child model errors are displayed first, instead of the parent's. Since the parent fields are the first to show up, those errors should be displayed first. any ideas on what I could be doing wrong? Thanks again.
Array#split is an ActiveSupport extension. If you want to use the history code in irb be sure to require 'active_support/core_ext/array'
Ryan,
I haven't tried this yet, but is this the solution to completing the "survey series" (#196, #197) ?
Or do you have something else ?
If so, I'd love to see a final episode to complete the survey app, i.e. where a user can answer the questions on the survey.
Mike
@Jelle Vandebeeck & Nicolas Marchildon
Just require the gem in your Gemfile and sources should be handled at the same time. No need to let Rubygems handle the source =)
I have a question regarding how to save the search model that contains a field with multiple checkboxes: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/50915dfb233d62bc#
Please click on the link and help. Thanks.
Artisiom:
Look at the example source in lib>authentication.rb
(Also, I accidentally clicked "Report as Spam" on your post. Sorry!)
I was missing:
gem sources --add http://gemcutter.org
What do you have in your gem sources?
settingslogic does work for that too
http://github.com/binarylogic/settingslogic
Hi,nice article for beginners.I would like to know if cucumber works for AJAX based functions.If yes,how?If no,Why?how can it be achieved?
Thnx for the Tutorial Ryan!
I have a small problem when I try to use postgresql...
I always get the following error when trying to start my server:
gem install activerecord-postgresql-adapter
But this gem doesn't exist and I installed the pg gem...
Do you know what could be the problem?
Thanx!
ryan,
the video's sweet and it's convinced me to try out whenever on my ubuntu 8.04 hardy server.
Anyway, I installed the gem using sudo and the installation went well.
Nevertheless, it's not so sweet now as the 3rd cron entry to remove items off the app's tmp/cache doesn't work.
It's got some issues with RAILS_ROOT not being set despite the fact that I have even set the path
(ie set :path, "<location of my app>").
Now , when I run "whenever", this is what I got.
barney_dinasour@evolutionct9a:~/projects/myApp$ whenever
/usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:20:in `initialize': /usr/local/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:105:in
`const_missing': uninitialized constant Whenever::JobList::RAILS_ROOT
(NameError)
from (eval):12:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:37:in `every'
from (eval):11:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `eval'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:20:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `cron'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
command_line.rb:31:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
command_line.rb:5:in `execute'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/bin/whenever:
30
from /usr/local/bin/whenever:19:in `load'
from /usr/local/bin/whenever:19
barney_dinasour@evolutionct9a:~/projects/myApp$
My configuration:
----------------------
* gem version is 1.3.5
* rails 2.3.5
* Ubuntu Hardy 8.04
Can anyone please help? :) thanks
Great job Ryan!
@steve, thank you for this info, I was pretty sure the china's great firewall do not block gems.rubyforge.org, but the fact is I only cannot access this one. In my browser I cannot open http://gems.rubyforge.org/yaml if I don't use a proxy. No problem with others gem website.
@bryan, thank you for the github link. But I still I have a problem :
I downloaded sources then build and install every packages (actionpack, activerecord, etc...), then rails rails-3.0.0.beta1. Everything seems ok, but when I run my app with rails server, it says it cannot find rails sources in gems dir. And after checking I cannot find sources in rails-3.0.0.beta1 gem dir. So maybe I did something wrong during installation.
Another question, what's the best place at the moment to talk about rails 3 install problem ?
Ruby Tube: http://rubytu.be/ is also a great place for finding screen casts.
ryan,
the video's sweet and it's convinced me to try out whenever on my ubuntu 8.04 hardy server.
Nevertheless, it's not so sweet now cause I cannot run "whenever".
Anyway, I installed the gem using sudo and the installation went well.
Now , when I run "whenever", this is what I got.
barney_dinasour@evolutionct9a:~/projects/myApp$ whenever
/usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:20:in `initialize': /usr/local/lib/ruby/gems/1.8/gems/
activesupport-2.3.5/lib/active_support/dependencies.rb:105:in
`const_missing': uninitialized constant Whenever::JobList::RAILS_ROOT
(NameError)
from (eval):12:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:37:in `every'
from (eval):11:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `eval'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
job_list.rb:20:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
base.rb:4:in `cron'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
command_line.rb:31:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/lib/whenever/
command_line.rb:5:in `execute'
from /usr/local/lib/ruby/gems/1.8/gems/whenever-0.4.1/bin/whenever:
30
from /usr/local/bin/whenever:19:in `load'
from /usr/local/bin/whenever:19
barney_dinasour@evolutionct9a:~/projects/myApp$
My configuration:
----------------------
* gem version is 1.3.5
* rails 2.3.5
* Ubuntu Hardy 8.04
Can anyone please help? :) thanks
I should add that this only happens when updating a record which already has nested child records.
Another great screencast!
I know that validations aren't dealt with here... as far as I can tell they _just work_, with one issue: if a nested record has been removed and the form submission fails validation, that record will be visible again (although it will still be deleted when the valid form is submitted).
I think this is simply because we need a javascript function to run when the body loads which checks for any hidden delete fields with a value of 1 and hides the associated row. Can anyone conjure up the appropriate javascript? Thanks.
happy 200! :)
very nice one, thanks!
+1 for combination with formtastic
+1 for usually using formtastic in railscasts ;-)
Hmm maybe I'll just have to stick with jQueryUI.. But jQTouch seems to do more...
Thx for this nice screencast!
I like the JQTouch Interface Plugin with Themes. Is there a similar solution for standard web apps? I mean a comparable css theme that makes developing Web-GUIs easier by suppling nice features like buttons and so on?
Is there something you can recommend?
@Alex, @Ryan, @Juan, @Frederic:
I have managed to separate caches for mobile and normal browsers. I do most of the work in .htaccess fils. So you should serve your application under Apache. The solution is super easy. You can review it at
http://www.badrit.com/blog/2010/2/2/keeping-separate-caches-for-mobile-browsers
--
Ahmed ElDawy
www.badrit.com
For those wondering about Ruby 1.9.1 vs 1.9.2. Rails 3 does support Ruby 1.9.1 but recommends 1.9.2. Since the latter is not yet released and I had some difficulties with it, I am showing 1.9.1 here.
@steve, right, I ran into the rack-mount dependency issue this morning as well. It will be fixed soon by a new release of Rails 3 beta gem.
@fred zingg
For what it's worth, I'm in China too and have no problem accessing ruby gems from the command line without a proxy. Youtube, Vimeo, and Danwei, on the other hand...
If anyone has any hang-ups with rack-mount, this is my experience:
gem install rack-mount now installs version 0.5.0 instead of 0.4.5... not sure why that should be a problem, but when i tried to install rails --pre, i got this:
ERROR: Error installing rails:
actionpack requires rack-mount (~> 0.4.0, runtime)
I don't think rvm contributed to these problems, but i got this error after installing 1.8.7-p248 with rvm (I had installed p249 but that gave some errors when trying to install any version of Rails, so I reverted to p248 after reading that had fixed someone's problems with Rails 3). Now I still get segfaults for gem installs sometimes, then they work for no apparent reason the next time I try. That seems to be a minor issue with rvm that I can live with.
I noticed that this screencast worked with rack-mount 0.4.5. So, after uninstalling rack-mount, I tried:
gem install rack-mount --version=0.4.5
This worked the second time (after a segfault the first time).
Then I tried once more:
gem install rails --pre
And after waiting a few minutes with nothing happening...
7 gems installed
rails -v
Rails 3.0.0.beta
@Doug, it depends on how your system Ruby is set up, but most likely you will want to use "sudo" with that, yes.
@jdv, rvm updated rubygems and rake for me when I did the install which is why I did not cover that here. I'm guessing this is a recent change.
@fred, you can clone Rails 3 directly from GitHub instead of installing as a gem. I'm not sure how to fix the proxy error, sorry.
@Gustavo, thanks for the suggestion. Feel free to grab the ribbon and badge I use on this site.
How do you add tuples to this
relationship? And how do you access one product's categories?
Michael Thanks! I was able to get the pagination.js into the page header using the call
<script src="/javascripts/pagination.js" type="text/javascript">
</script>. Does anyone now why <% javascript "pagination" %> defined in the rails cast didn't work for me? It didn't fail, but it didn't list the jscript library in my header either. I wasn't using index.html.erb as my file name. Could this be why?
hello, GREAT tutorial.
I've got about half way though, where i need to test the invitaiton, and invite count decrements as expected. It handles missing email field, but when I enter an email address that is not listed already, I get:
undefined method `generate_token' for #<Invitation:0x2563bf8>
The invitation_controller has this:
@invitation.sender = @user
i used @user and user but bith return the same issue.
ANy ideas?
THanks
#200, yey! Ryan, I think you should give some badges, images or buttons, etc, so more people help you promote the "Give back to open source" campaign in their sites!
Congrats for the #200. Thank you Ryan for your screencasts :)
Thank you Ryan.
Thank you for this new awesome cast ryan !
But maybe you could help me with my problem :
I installed rvm, ruby-19.1 and all rubygems (tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n) without any trouble.
But when I want to install rails 3 I got this issue below.
I'm using this command :
gem install rails --pre --debug -r --http-proxy http://127.0.0.1:9666
(I'm using a proxy because i'm living in China and I cannot access directly to http://gems.rubyforge.org/ from few months. So usually when I install a new gem, i use a proxy or I download directly the gem from the web)
the trace :
Exception `Gem::Package::FormatError' at /home/Acer-fredo/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:110 - No metadata found!
Exception `Gem::InstallError' at /home/Acer-fredo/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:121 - invalid gem format for /home/Acer-fredo/.rvm/gems/ruby-1.9.1-p378/cache/activesupport-3.0.0.beta.gem
ERROR: Error installing rails:
invalid gem format for /home/Acer-fredo/.rvm/gems/ruby-1.9.1-p378/cache/activesupport-3.0.0.beta.gem
Probably it comes from my proxy problem, but i'm not sure.
Do you have an idea or do you know where I can directly download rails-3.0.0 gems ?
Thanks.
Thank you very much for your dedication to these wonderful screen casts. My little team has started developing apps(for the group companies we work for) with Ruby on Rails for a month, and the speed and the joy just went up by huge amount.
When we face a challenge, we prefer railscast than book, because it's well explained, and very practical. And it works!
We must say "Thank you, Ryan!".
Ryan, you can use "git clone --depth=1" unless full git history log is needed
Providing inventory management application keep track on entire business process and make it smooth.
To install on OSX, this is missing two bugfix things you need to do. If you don't, you'll get an error like:
<pre>readline.c:703: error: 'filename_completion_function' undeclared (first use in this function)</pre>
1. instead of rvm install 1.8.7 or 1.9.1, run:
CPPFLAGS="-DHAVE_RL_FILENAME_COMPLETION_FUNCTION -DHAVE_RL_USERNAME_COMPLETION_FUNCTION -DHAVE_RL_COMPLETION_MATCHES" rvm install 1.8.7
(or 1.9.1 or whatever)
2. after you run <pre>rvm 1.8.7</pre> and before you go to install the rails beta gem, run:
gem sources -r http://gems.rubyonrails.org
... for whatever reason, their gemserver is really old and not compatible. It's on github anyway.
Also, related to the load of output and bundler error one may see when running rails commands inside a rails application, it's likely to be related to bundler.
There are some instructions about how to get rid of them:
http://www.ozmox.com/2010/02/07/fixing-rails-3-beta-invalid-gemspec-format-errors/
The proposed fix and some variants of it have made their ways into several bundler forks on github, so one may expect to install a new release of bundler soon I guess :)
Notes about rubygems:
1. You forgot the rake dependency:
gem install rake
2. you may hit upon the following error:
ERROR: Error installing bundler:
bundler requires RubyGems version >= 1.3.5
Then you can fix this with:
gem install rubygems-update
update_rubygems
gem install bundler
Everything should be fine then.
Hello - just in case anyone else working on a mobile app ran into the same problem I did where your dev env creates asset URLs with "http://localhost:3000/" (see comment #29) - here's how I got around the issue:
I added the following to my config/environments/development.rb:
config.after_initialize do
ActionController::Base.asset_host = ''
end
Hope that helps!
Thank you for this nice episode, and for the forthcoming ones. Didn't know about rvm, it's a lifechanger!
Great screencast!
I was able to immediately apply it to a project I'm working on, and get a pretty complicated story done quickly.
(Unfortunately I didn't see some of the recent forks, and ended up doing the unobtrusive jquery stuff myself)
What is the best way to test the helper methods?
I would like to keep our code coverage up, and assert that the js escaping and new_record ids are being assigned, and I tend to test helper methods explicitly, but in this case I'm not sure how to test the 'link_to_add_fields' method, which calls out to the render method.
Has anyone else added tests for these methods? (hopefully I'm missing something obvious)
thanks!
Is it alright to use sudo before gem install/upgrade, provided I'm using the version of ruby I had prior to using rvm? Without it, it installs gems in ~/.gem.
@George, if you are using rvm as I show in this episode you can simply switch back to your older version of Ruby and it will use the older version of Rails.
Also specifying the rails version in your config/environment.rb (for 2.3 projects) will work so you can easily juggle multiple Rails apps with multiple versions.
@Nicholas, thanks for the link on fixing the stderr output!
@Hussein, thanks for the corrections and update! It is good to know 1.9.2 is receiving more focus.
Jeremy Kemper said:
Rails 3 will definitely prefer Ruby 1.9.2.
If you’re running 1.9, I’d recommend building 1.9.2dev rather than using 1.9.1. It’s big upgrade, it has quite a few behavior changes, and Rails master is developed against 1.9.2 exclusively (though we do continuous integration against 1.9.1 for good measure).
The key to *requiring* 1.9.2 is full mysql-ruby, pg, and sqlite3-ruby encoding support. These database drivers have had ages to upgrade but still aren’t up to snuff. Pitch in, make it happen, and you’ll find the database-backed web app world one step behind you.
Ryan, congratulations on episode 200! Thanks a lot for your great work. I do appreciate it!
All the junk in the stderr output in the terminal is a known issue (it's not for debugging). You can get rid of it if you follow the direction here: http://bit.ly/bNiLrS
Oops. Sorry, that was a stupid question. I guess I'm getting tired.
Again - thanks for Railscasts!
This is great. Thanks Ryan.
I am wondering how would I switch back or downgrade to rails 2.3.4?
Thanks.