[Rails] Re: Testing: executing visit command ends session

2015-06-26 Thread Jason Hsu, Rubyist
I get error messages that indicate that nobody is logged in. The admin should be able to view the admin index page, but the users and the general public should not be able to. Unfortunately, the test doesn't show that the admin can view the admin index page. While this works in my

[Rails] Re: Testing: executing visit command ends session

2015-06-26 Thread Jason Hsu, Rubyist
The problem is that the session is lost as soon as the visit command is invoked. How do I get the test to retain the session? Also, that link you cited revolves around RSpec instead of Minitest. Are there any good examples of someone who has successfully done what I'm trying to do? I can't

[Rails] Testing: executing visit command ends session

2015-06-25 Thread Jason Hsu, Rubyist
The code in question is at https://github.com/jhsu802701/generic_app_template/blob/master/test/integration/admins_view_test.rb . I've used the Devise gem to create users and admins. I've successfully made the admin index page visible ONLY to admins, but it's failing the tests (Capybara and

[Rails] Testing for redirects

2015-06-21 Thread Jason Hsu, Rubyist
I have an app with admin users created with the devise gem. I have succeeded in redirecting anyone who tries to access an admin profile page but is NOT logged in as an admin to the root_path (http://localhost:3000). However, I'm having difficulty getting the tests to pass in my integration

[Rails] Rails/Devise: testing the user confirmation process

2015-06-03 Thread Jason Hsu, Rubyist
BACK STORY: I'm working on a Rails app template that is similar to the Rails Tutorial Sample App. The idea is to begin every app I ever start with a pre-made template so that I don't have to plow through chapters 3 through 10 in Rails tutorial. I can have the app set up AND tested in just a

[Rails] Do you use the devise gem to create users in your Rails apps?

2015-04-26 Thread Jason Hsu, Rubyist
I'd like to hear your opinions. On the one hand, it's clearly easier in the short run to use the devise gem. On the other hand, Rails Tutorial maintains that modifying an off-the-shelf solution is a black box and can be more work than creating the user functionality from scratch. -- You

[Rails] Debian Jessie Vagrant box with RVM

2015-04-23 Thread Jason Hsu, Rubyist
Debian Jessie is about to become the new Debian Stable. I have released my new Debian Jessie Vagrant box at https://github.com/jhsu802701/vagrant-debian-jessie-rvm as a replacement for the old Debian Wheezy Vagrant box. The old Debian Wheezy Vagrant box is still available, but I will not be

[Rails] Updated Rails site: Lose Money Fast

2015-04-23 Thread Jason Hsu, Rubyist
Check out my new and improved version of my Rails site Lose Money Fast at https://losemoneyfast.herokuapp https://losemoneyfast.herokuapp.com/­ . You can buy thousands of fictional Mega Millions and Powerball tickets every virtual week. You never run out of money, but your return on

[Rails] NEW GEM: GenericGem

2015-03-19 Thread Jason Hsu, Rubyist
Check out my new gem called GenericGem, which streamlines the process of creating a new gem. There are many generic and routine tasks common to all or most gems but are all too easy to forget. GenericGem takes care of these tasks so that you can focus on your gem's unique capabilities. Just

[Rails] YOUTUBE: Debian Stable Vagrant Box (plus music)

2015-03-06 Thread Jason Hsu, Rubyist
Check out my 3-part YouTube presentation on my Debian Stable Vagrant box at http://www.youtube.com/playlist?list=PLfd4iay29eVBey-eRCvjWvO1pGj4_E_Us . Your Ruby on Rails environment will be ready to roll in MINUTES instead of hours. If RVM behaves in unexpected ways, or if you need to make

[Rails] Re: YOUTUBE: Debian Stable Vagrant Box (plus music)

2015-03-06 Thread Jason Hsu, Rubyist
As an added bonus, these videos have catchy musical soundtracks. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to

[Rails] PostgreSQL password in environment variables

2015-02-20 Thread Jason Hsu, Rubyist
I've heard that using environment variables to provide the password and other PostgreSQL parameters is the way to go. Is the Nitrous.io way (explained at http://help.nitrous.io/postgres/) the way you do it? Or is there a better way? -- You received this message because you are subscribed to

[Rails] Heroku: Why isn't the config/database.yml file relevant?

2015-02-20 Thread Jason Hsu, Rubyist
As you know, Heroku uses the PostgreSQL database by default. However, when you deploy an app that you created with the use of SQLite in the development environment, the config/database.yml file on the Heroku server is still configured for SQLite. Exactly how does Heroku make the

[Rails] RVM alternatives

2015-02-05 Thread Jason Hsu, Rubyist
I understand that some people prefer rbenv, chruby, and perhaps other programs over RVM for Ruby on Rails. There is a list of alternatives at https://github.com/wayneeseguin/rvm/blob/master/docs/alt.md . I'm using RVM, because that's what most people use and because that's what

[Rails] Why isn't Vagrant standard practice?

2015-02-04 Thread Jason Hsu, Rubyist
I'm doing my part. My Debian Stable Vagrant box with pre-installed Ruby on Rails (https://github.com/jhsu802701/vagrant_debian_wheezy_rvm) is now part of my standard operating procedure. Is there any reason that use of Vagrant is NOT already universal in the Ruby on Rails community? The

[Rails] NEW RELEASE: Debian Wheezy RVM Vagrant box

2015-02-03 Thread Jason Hsu, Rubyist
I have released version 2015_02_03 of my Debian Wheezy RVM Vagrant box ( https://github.com/jhsu802701/vagrant_debian_wheezy_rvm). Note that the Vagrant setup now includes separate SQLite and PostgreSQL tests in the shared directory. In addition to updated packages, the new box provides the

[Rails] Shortcuts for creating a Ruby on Rails app

2015-01-26 Thread Jason Hsu, Rubyist
I just released a new Ruby gem called generic_app. It uses the latest Rails Tutorial Sample App from a point just before the addition of microposts and followers. Thus, you start off with a generic app and save yourself the work of having to install static pages, Twitter bootstrap, tests,

[Rails] Finish Ruby command BEFORE moving on to the next

2015-01-22 Thread Jason Hsu, Rubyist
THE EASY PART: I have four Ruby commands in a Ruby script that need to be executed in the following order: 1. long_command1 2. long_command2 3. long_command3 4. long_command4 THE HARD PART: How do I make sure that the Ruby script finishes one command before moving on to the next one?

[Rails] Guard not updating in Vagrant

2015-01-09 Thread Jason Hsu, Rubyist
Guard in the completed railstutorial.org sample app (https://github.com/mhartl/sample_app_3rd_edition.git) should automatically run the tests as soon as I save a change in any of the files. When I try out the app in Nitrous.io, Guard works as expected. When I save a change to any of the files

[Rails] Re: Getting Guard tests to run AUTOMATICALLY

2015-01-09 Thread Jason Hsu, Rubyist
I've tried out the complete sample app from https://github.com/mhartl/sample_app_3rd_edition to ensure that I didn't overlook something. Now I realize that Guard does respond by automatically executing a test when one of the files it watches changes. Unfortunately, it takes a few MINUTES to

[Rails] Getting Guard tests to run AUTOMATICALLY

2015-01-08 Thread Jason Hsu, Rubyist
I'm going through Hartl's Rails tutorial, which now uses Rails 4.2 and Guard with minitest. Having Guard up and running does not automatically run tests; I have to press Enter to trigger the tests. I can get the tests to run automatically upon starting Guard by changing guard :minitest,

[Rails] My new Rails app: Lose Money Fast

2014-11-20 Thread Jason Hsu, Rubyist
It's at https://losemoneyfast.herokuapp.com/ . If you ever wondered how you'd fare if you could buy thousands of lottery tickets per drawing, my new Rails app Lose Money Fast will allow you to simulate this. It also keeps track of your total spending, your total winnings, and your return on

[Rails] Re: Ruby on High Speed Rails: Debian Stable Vagrant box

2014-11-03 Thread Jason Hsu, Rubyist
I have released version 0.1.0 of my debian-wheezy-rvm Vagrant box. Just clone my Vagrant setup at https://github.com/jhsu802701/vagrant_debian_wheezy_rvm to get started. I have already begun using my own public Vagrant setup and Vagrant box to work on a Rails project. My Vagrant base box is

[Rails] Ruby on High Speed Rails: Debian Stable Vagrant box

2014-10-28 Thread Jason Hsu, Rubyist
My presentation on Vagrant is at: https://drive.google.com/file/d/0B6n9UlfqV3juc3NleW9PdWtydTA/view?usp=sharing The Vagrant repository that I'm now using for Ruby on Rails development is at https://github.com/jhsu802701/vagrant_debian_wheezy_rvm . My Vagrant base box includes the latest

[Rails] Debian Stable Vagrant box for Ruby on Rails

2014-10-21 Thread Jason Hsu, Rubyist
I have created a Vagrant setup for using a Debian Stable base box at https://github.com/jhsu802701/vagrant_debian_wheezy_rvm . This base box comes with current versions of RVM, Git, SQLite, PostgreSQL, Chef, Puppet, and node.js preinstalled. My Vagrant box and Vagrant setup allow you to get

Re: [Rails] New gem: copy_rails_tutorial

2014-10-08 Thread Jason Hsu, Rubyist
Thanks, Don. I never heard of the Hobo gem, and I'm surprised that I've never heard of it. I'll be sure to try it out given how much work it can save. It's great to find out that I'm not the only one who has been looking for a way to streamline the process of STARTING a project by creating

[Rails] Hobo and other gems for rapid prototyping

2014-10-08 Thread Jason Hsu, Rubyist
Don Ziesig, thanks for bringing up the hobo gem for rapid prototyping. Now I know that I wasn't the first person to think of the idea of streamlining the process of starting a Rails site instead of having to follow all of the steps in chapters 3 through 9 of Rails tutorial. I learned a lot

[Rails] New gem: copy_rails_tutorial

2014-10-07 Thread Jason Hsu, Rubyist
People have complained that it takes far longer to create a basic app in Rails than in Drupal, PHP, and other technologies. I've decided to do something about it by streamlining the process of starting a basic app. Check out my new Ruby gem copy_rails_tutorial. It copies Michael Hartl's

[Rails] Cannot load rspec/core/rake_task

2014-09-18 Thread Jason Hsu, Rubyist
I'm working on a Ruby gem. The rake command works as expected in my Mac setup, but when I enter the rake command on my Linux setup in VirtualBox with a FRESH Ruby on Rails setup, I get the following error message: rake aborted! cannot load such file -- rspec/core/rake_task

[Rails] Re: Cannot load rspec/core/rake_task

2014-09-18 Thread Jason Hsu, Rubyist
I solved the problem by taking out the version number specifications of bundler and rake (development dependencies) in the gemspec. These constraints (created by default when I ran the initial command to create the gem directory structure) caused conflicts. -- You received this message

[Rails] Sites listing Ruby on Rails challenges

2014-09-09 Thread Jason Hsu, Rubyist
Is there a site that lists Ruby on Rails challenges to try? I think I found a mention of such a site once, but I forgot the URL, and I haven't been able to find this site. I don't mean tutorials like railstutorial.org or railsbridge.org but sites that provide coding challenges to try - the

[Rails] Spreadsheet of Ruby on Rails resources

2014-08-07 Thread Jason Hsu, Rubyist
https://docs.google.com/spreadsheets/d/1X84UGD5yONWzpKV_8H00mSlkXrb6Ariditq1PHMn810/edit?usp=drive_web I'm compiling a list of resources for learning Ruby on Rails at the above URL. I'd appreciate your input and that of others in the Rails community. One of the parameters is the level of the

[Rails] Testing without RSpec

2014-07-24 Thread Jason Hsu, Rubyist
Are there any good tutorials on testing a Rails app WITHOUT the aid of RSpec? Testing at railstutorial.org revolves around RSpec. However, I need to learn about testing (such as unit testing and frame testing) WITHOUT RSpec so that I can contribute to projects that don't use it. -- You

[Rails] Re: Additional Ruby on Rails tutorials

2014-07-17 Thread Jason Hsu, Rubyist
OK, some other tutorials I've found out about are: http://ruby.bastardsbook.com (free) http://learn-rails.com ($19) Kudzai, Pragmatic Studio sounds great, but it's far more expensive than the others. Thus, I consider the free and cheaper tutorials to be higher priorities. I may still try the

[Rails] Additional Ruby on Rails tutorials

2014-07-16 Thread Jason Hsu, Rubyist
I've gone through Michael Hartl's railstutorial.org, and I'm currently revisiting it. In fact, I use it as a resource for developing apps (especially in the early stages). I will also go through the railsbridge.org tutorial. Are there additional Ruby on Rails tutorials I should go through? I

[Rails] Re: Running Mac OS X guest OS in VirtualBox

2014-06-04 Thread Jason Hsu, Rubyist
Some updates: 1. Seeing screen output when you boot up with the Mac OS X ISO file requires going to the Settings - Display menu and providing enough video memory. The default setup is virtually no video memory. Setting it to the full 128 MB of video memory allowed me to see screen output. 2.

[Rails] OT: Squashing Git commits AFTER pushing them

2014-05-28 Thread Jason Hsu, Rubyist
BACK STORY: I'm working on the rubygems.org site. So far, all I've done is fill in the missing details on setting up the project. (The only two files I've changed are config/database.yml.example and CONTRIBUTING.md.) I forked the project, made changes, pushed them, and submitted a pull

Re: [Rails] OT: Squashing Git commits AFTER pushing them

2014-05-28 Thread Jason Hsu, Rubyist
--force origin your_branch Your commits should be updated on the pull request also. Hope this helps. 2014-05-28 14:51 GMT-07:00 Jason Hsu, Rubyist jhsu8...@gmail.comjavascript: : BACK STORY: I'm working on the rubygems.org site. So far, all I've done is fill in the missing details

[Rails] Re: Running Mac OS X guest OS in VirtualBox

2014-05-21 Thread Jason Hsu, Rubyist
I followed the instructions for generating the Mavericks ISO file. It doesn't work when I try to boot it up in VirtualBox. There's just a blank black screen. Did I miss an important detail? On Wednesday, May 7, 2014 5:09:49 PM UTC-5, Shiva S wrote: Has ANYONE here SUCCESSFULLY installed

[Rails] A better Ruby gem search engine

2014-05-19 Thread Jason Hsu, Rubyist
For those of you who don't like the current gem search engine at rubygems.org, I have deployed a better search engine at http://www.rubygemsearch.org/ . You can search Ruby gems by name, by description, or by other parameters. You can sort the results by number of downloads or by other

[Rails] Dependencies in the gemspec

2014-05-05 Thread Jason Hsu, Rubyist
There are runtime dependencies, development dependencies, and unlabeled dependencies (add_dependency). What exactly are the differences among these dependencies? When do you make a dependency a runtime dependency only? When do you make it a development dependency only? And does

[Rails] Running Mac OS X guest OS in VirtualBox

2014-05-02 Thread Jason Hsu, Rubyist
I have plenty of experience using Linux as a host OS and as a guest OS. I like using VirtualBox for Ruby on Rails development because of its ability to save snapshots. In my early days, I found this indispensable for installing Ruby on Rails. I still like VirtualBox for Ruby on Rails

[Rails] OT: buying a Mac computer

2014-02-25 Thread Jason Hsu, Rubyist
I realize this is off-topic, but I understand that an overwhelming majority of Rubyists use Mac computers and not PCs. I currently use Linux-powered PCs. Yes, I ditched Windows years ago just like many of you. Using Linux on a used PC is the cheapest way to compute. (I've been able to buy a 4

Re: [Rails] OT: buying a Mac computer

2014-02-25 Thread Jason Hsu, Rubyist
At the local Ruby, Python, Javascript, and other user groups, an overwhelming majority of the laptops I see are Macs, not PCs. I'm not saying that Macs are inherently better than Linux-powered PCs. (I'm not giving up on the latter by any means.) It would be good to have the versatility to

Re: [Rails] Re: OT: buying a Mac computer

2014-02-25 Thread Jason Hsu, Rubyist
On Tuesday, February 25, 2014 6:05:35 PM UTC-6, Lei Zhao wrote: To answer Jason’s questions, OS X has changed a lot over recent versions, especially Lion and Mountain Lion. But most of the major changes are UI-related, like natural scrolling, mission control, etc. Missing them could

Re: [Rails] How do I use Chef to manage database parameters?

2013-11-09 Thread Jason Hsu, Rubyist
Thanks, but I still don't understand how to use chef. Let's say that I'm using PostgreSQL for my database, and the name of the database is pg_test1. Suppose that in my development environment, the database username is user1, and the database password is password1. In my production

[Rails] Re: can anyone please suggest me from where I need to start learning ruby on rails..??

2013-11-07 Thread Jason Hsu, Rubyist
My suggestions: 1. Learn object-oriented programming in Python. Python is easier to install, learn, and read than Ruby, and it paved the way to learning Ruby. 2. Learn Ruby before learning Rails. (tryruby.org provides a good introduction.) I know that the majority of other Rubyists will

[Rails] How do I use Chef to manage database parameters?

2013-11-07 Thread Jason Hsu, Rubyist
As you know, the correct database name, username, and password in config/database.yml are needed for a Rails site to work. I understand that the elegant way to provide these parameters is to use the Chef tool. However, I can't figure out how to do this. I'll explain the solution I'm using

[Rails] Using Chef to set the database name, username, and password

2013-11-01 Thread Jason Hsu, Rubyist
One of my Ruby on Rails apps is Bargain Stock Funds (https://github.com/jhsu802701/bsf), and it relies on a Ruby gem called bsf_scrape (https://github.com/jhsu802701/bsf_scrape) to obtain and process data on stock funds and then save the results in a PostgreSQL database. As you well know, the

[Rails] My new Ruby gems: string_in_file and array_in_file

2013-10-24 Thread Jason Hsu, Rubyist
I have published the Ruby gems string_in_file and array_in_file. Think of them as the ultimate global variables. string_in_file is used for storing a string in a file. In addition to writing a string value to a file and reading a string value from a file, you can also: 1. Check to see if a

[Rails] OT: best solutions for tracking projects and skills needed

2013-10-11 Thread Jason Hsu, Rubyist
I realize this is off-topic, but I'm not sure what forum is best for asking about this. I figure that at least a few of you are involved in civic hacking groups. I recently joined a group that does civic hacking. (Adopt-A-Hydrant is an example of civic hacking.) We need a solution for

[Rails] What license do you use for your Ruby gems?

2013-10-11 Thread Jason Hsu, Rubyist
I have created two Ruby gems (dvi_scrape and bsf_scrape), and I'm planning on creating a few more. What license should I be using for my Ruby gems? I'm creating these gems on my own and not on behalf of any particular organization. -- You received this message because you are subscribed to

[Rails] Re: What license do you use for your Ruby gems?

2013-10-11 Thread Jason Hsu, Rubyist
On Friday, October 11, 2013 7:21:57 PM UTC-5, Ruby-Forum.com User wrote: That's really up to you AFAIK. I typically use the MIT license on my stuff, but choosing a license can be a fairly personal choice. It depends on what you're trying to protect, or not protect, whatever the case may

[Rails] Why does Rails debug information shows up in production?

2013-09-11 Thread Jason Hsu, Rubyist
I recently upgraded Bargain Stock Funds (http://www.bargainstockfunds.com) and Doppler Value Investing (http://www.dopplervalueinvesting.com) from Rails 3.2 to Rails 4.0. I've noticed that the debug information is on the production web site even though the

[Rails] Re: Why does Rails debug information shows up in production?

2013-09-11 Thread Jason Hsu, Rubyist
I've done some troubleshooting and have confirmed that what should be my production environment is being seen by Rails as the development environment instead. What is the proper way to make sure that my production environment is actually seen by Rails as the production environment? Please

[Rails] Re: Why does Rails debug information shows up in production?

2013-09-11 Thread Jason Hsu, Rubyist
I found out what the problem was. The nginx.conf file in the production environment (which is automatically generated when I create the Rails 4.0 app in WebFaction) specified the development environment instead. I changed it to specify the production environment. Now the production

[Rails] Re: Rails sites went down without my knowledge

2013-09-10 Thread Jason Hsu, Rubyist
Thanks, Jordon. The best web site monitoring solution I found is through Google Docs. For more on this solution, go to: http://www.labnol.org/internet/website-uptime-monitor/21060/ -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To

[Rails] Rails sites went down without my knowledge

2013-09-09 Thread Jason Hsu, Rubyist
I found that both of my Rails sites went down tonight without my knowledge, and I was getting 502 errors when I tried to visit these sites. Both are hosted by the same company. Fortunately, I was able to get the sites back up and running simply by restarting them. Are there any services out