Search Results

Search found 9437 results on 378 pages for 'rails newbie'.

Page 14/378 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Newbie Python programmer tangling with Lists.

    - by Sergio Tapia
    Here's what I've got so far: # A. match_ends # Given a list of strings, return the count of the number of # strings where the string length is 2 or more and the first # and last chars of the string are the same. # Note: python does not have a ++ operator, but += works. def match_ends(words): counter = 0 for word in words: if len(word) >= 2 and word[0] == word[-1]: counter += counter return counter # +++your code here+++ return I'm following the Google Python Class, so this isn't homework, but me just learning and improving myself; so please no negative comments about 'not doing my homework'. :P What do you guys think I'm doing wrong here? Here's the result: match_ends X got: 0 expected: 3 X got: 0 expected: 2 X got: 0 expected: 1 I'm really loving Python, so I just know that I'll get better at it. :)

    Read the article

  • C++ Newbie: Passing an fstream to a function to read data

    - by vgm64
    I have a text file named num.txt who's only contents is the line 123. Then I have the following: void alt_reader(ifstream &file, char* line){ file.read(line, 3); cout << "First Time: " << line << endl; } int main() { ifstream inFile; int num; inFile.open("num.txt"); alt_reader(inFile, (char*)&num); cout << "Second Time: " << num << endl; } The output is: First Time: 123 Second Time: 3355185 Can you help me figure out how to get an fstream that is read in a function still assign the variable in main? I'm doing this because alt_reader really has a lot more to it, but this is the part I'm stuck on. Thanks a lot for the help.

    Read the article

  • Rails app returns HTTP 422 for new ServerAlias - Internet Explorer only

    - by Snips
    I have a long-standing Rails app running on Mac OS X (apache2). The set-up uses Apache virtual hosts and Passenger. The Rails app also uses HTTP Basic Authentication. I need to migrate the app from one url domain to another - with some overlap of both domain names being accessible simultaneously for a period. To do this, I've added the new domain name as a ServerAlias of the existing domain name in the Passenger Virtual Host config. I can now Browse the Rails app using both the legacy url, and the new url from any of Safari, Chrome, Firefox, or Internet Explorer. I can also 'HTTP post' updates to the Rails app using Safari, Chrome, or Firefox. All good. Except, attempts to post updates from Internet Explorer result in the Rails app rejecting the update, The Rails app log contains the message, ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): I have other domains & aliases working just fine on this same machine. Any suggestions as to what is causing the Rails app to reject posts from IE would be appreciated.

    Read the article

  • How can I setup nginx to serve virtualhosts with rails(unicorn/passenger) and php-fpm

    - by NewAlexandria
    I would like to serve multiple sites on one instance. I install nginx, php-fpm, and a rails app. I use sites like this to guide me. I configure php-fpm to listen to a local socket listen = /var/run/php-fpm/php-fpm.sock I configure ngnix with multiple hosts: include /etc/nginx/conf.d/*.conf I have several site php conf files like /etc/nginx/conf.d/site1.conf server { listen 80; server_name site1.com www.site1.com; root /var/www/site1; location / { index index.html index.php; } location ~ \.php$ { fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; } } and rails site conf files like upstream rails { server 127.0.0.1:3000; } server { listen 80; server_name site2.com www.site2.com; root /var/www/site2; location / { proxy_pass http://rails; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_set_header X-Url-Scheme $scheme; } } I have a unicorn rails server running via rails s -p 3000 Yet, no sites come up for either site1.com or site2.com. I can get to the rails site at www.site2.com:3000 What is wrong? I've spent 2 days (nearly 30hr) trying many different blogs, SO / SF questions, etc. Please share your insight or answer. edit 1: No log entries are created when I try to visit either site. It's like the requests never come in.

    Read the article

  • Is it possible for beginner to learn and develop an application in rails in 4 months?

    - by Parth
    I want to develop a web application or a website using rails. My current knowledge includes 1. HTML 2. CSS 3. C 4. Java And I am currently going through 5th chapter of the well grounded rubyist book by David A. Thomas. I came to know that learning ruby is beneficial for good knowledge of rails. So currently I am going through the basics of ruby. And learning rails in parallel. I want to know if in this scenario is it practically feasible to understand rails and develop an application/website in it within the time frame of 4 months. I need to develop an application which have atleast 3 complexity (complex functionality). Any ideas of good application for rails beginners is welcomed. But the application should be large or if it is small than it should have some complexity. Time is a constraint for me. I would have to develop application for college work but rails technology is my choice as I want to learn it.

    Read the article

  • Rails and Mongoid best way to implement sharing system

    - by Matteo Pagliazzi
    I have to model User and Board in rails using mongoid as ODM. Each board is referenced to an user through a foreign key user_id and now I want to add the ability to share a board with other users. Following CRUD I'd create a new Model called something like Share and it's releated Controller with the ability to create/edit/delete a Share but I have some doubts: First, where to save informations about Shares? I think I may create a field in the Board's collection called shared_with including an array of user ids. in a MySQL I'd created a new table with the ids of who share, the resource shared and the user the resources is shared with but I don't think that's necessary using MongoDB. Every user a Board is shared with should be able to edit the Board (but not to delete it) so the Board should have two relations one with the owner and another with the users the board is shared with, right? For permission (the owner should be able to delete a board but the users it is shared with shouldn't) what to use? I'm using Devise for authentication but I think something like CanCan would fit better. but how to implement it? What do you think about this way? Do you find any problems or have better solutions?

    Read the article

  • Rails: Law of Demeter Confusion

    - by user2158382
    I am reading a book called Rails AntiPatterns and they talk about using delegation to to avoid breaking the Law of Demeter. Here is their prime example: They believe that calling something like this in the controller is bad (and I agree) @street = @invoice.customer.address.street Their proposed solution is to do the following: class Customer has_one :address belongs_to :invoice def street address.street end end class Invoice has_one :customer def customer_street customer.street end end @street = @invoice.customer_street They are stating that since you only use one dot, you are not breaking the Law of Demeter here. I think this is incorrect, because you are still going through customer to go through address to get the invoice's street. I primarily got this idea from a blog post I read: http://www.dan-manges.com/blog/37 In the blog post the prime example is class Wallet attr_accessor :cash end class Customer has_one :wallet # attribute delegation def cash @wallet.cash end end class Paperboy def collect_money(customer, due_amount) if customer.cash < due_ammount raise InsufficientFundsError else customer.cash -= due_amount @collected_amount += due_amount end end end The blog post states that although there is only one dot customer.cash instead of customer.wallet.cash, this code still violates the Law of Demeter. Now in the Paperboy collect_money method, we don't have two dots, we just have one in "customer.cash". Has this delegation solved our problem? Not at all. If we look at the behavior, a paperboy is still reaching directly into a customer's wallet to get cash out. EDIT I completely understand and agree that this is still a violation and I need to create a method in Wallet called withdraw that handles the payment for me and that I should call that method inside the Customer class. What I don't get is that according to this process, my first example still violates the Law of Demeter because Invoice is still reaching directly into Customer to get the street. Can somebody help me clear the confusion. I have been searching for the past 2 days trying to let this topic sink in, but it is still confusing.

    Read the article

  • VMPlayer 9, Xubuntu 12.10, Rails Development - Freezing frequently

    - by douglasisshiny
    I have a new Vizio Ultrabook that came with Windows 7. I develop Rails applications, and it's a pain to do that in windows, so I setup a Xubuntu VM with 1GB ram and 2 CPU cores. I basically keep the VM open all the time and have enough memory not to worry. Sometimes I pause the VM. For the first few days, everything was fine. The fourth day, Xubuntu froze up while running a test (with Guard and RSpec). I didn't think much of it and restarted the VM and went on my way. The freezes started becoming more frequent, though. I don't think they are only when I run a test, but often they are. It'll happen quickly, too. Startup VM, save file, test runs, it freezes, all within 5 minutes. Of note: the VM is using a shared folder from Windows (where the code is). This may be the problem. Any other people experience something like this?

    Read the article

  • Team Software Development using Ruby on Rails

    - by Panoy
    I used to work alone on small to medium sized programming projects before and have no experience working in a team environment. Currently, there will be 3 of us in an in-house software development team that is tasked to develop a number of software for an academic institution. We have decided to use the web for the majority of the projects and are planning to choose Ruby on Rails for this and I would like to ask for your inputs, advices and approaches with regards to software development as a team using the RoR web framework. One thing that has really confounded me is how you divide the programming tasks of a project if there are 3 of you that are really doing the coding. It’s obvious that we as developers approach a problem in a modular way and finish it one after another. If the project consists of 3 modules, should each one of us focus on each of those modules? Would it be faster that way? How about if the 3 of us would focus on one module first (that’s what I really prefer). Is using a distributed version control system such as Git the answer to this type of problem? Please don’t forget to put your tips and experiences with regards to team software development. Cheers!

    Read the article

  • newbie: Rails on remote Apache server not displaying index.html.erb

    - by paracaudex
    I played around with Rails on my laptop (running Linux + Apache + MySQL) and had no trouble getting the Getting Started with Rails tutorial to work locally. Now I'm trying the same thing at work on a remote Mac OS X + Apache server, and things aren't quite so rosy. I typed rails blog -d mysql to create a directory called blog in /Library/WebServer/Documents/mydirectory. The trouble is, if I go to server.com/mydirectory/public, I get the public/index.html in my browser. But, I don't get this file if I go to server.com/mydirectory/. Instead, I get a 403 error. Also, when I: script/generate controller home index to create: app/views/home/index.html.erb I am unable to view this file, whether I go to server.com/mydirectory/home/index, or if I add a new line (map.root :controller => "home") to config/routes.rb and go to server.com/mydirectory. Am I missing something really obvious about Apache and Rails?

    Read the article

  • Rails /tmp/cache/assets permissions issue using Debian virtual machine hosted on OS X Lion

    - by Jim
    I am running Parallels Desktop 7 on OS X Lion. I have a VM with Debian installed, and inside that VM I setup a Rails development environment. I am using Parallels Tools to share out my OS X home directory to the VM - the goal here is to run the Rails server on the VM, but host the files on OS X (so they are automatically backed up, and so I can use tools like Textmate to develop with). Everything seems to work with the shared directory - my Debian user can read, write, and execute files. However, when I cloned a recent Rails project from Git, I got an error message when it tried to compile the CSS assets. My symptoms are exactly the same as in the question: http://stackoverflow.com/questions/7556774/rails-sprocket-error-compiling-css-assest-chown-issue I believe this is permissions-based, but it is really weird. My entire Rails project directory has permissions set to 777 and my Debian user owns it. If I navigate into /tmp/cache/assets, those permissions are the same. However, the three-character directories Rails is creating (DCE, DA1, D05, etc...) are being created without write permissions! If I refresh the Rails page a few times, about 4 or 5 (with Rails creating new three-character directories every time), eventually it will create one of the directories with the proper 777 permissions and everything will work! This will persist until I make a change to the CSS files and it has to recompile. Does anyone have any idea what might be going on here? I can't fathom why it is creating temp directories with incorrect permissions, or why after a few refreshes the good permissions kick in and it works... It definitely seems to be an issue with the share, since if I move the project into a different directory on the VM, it seems to work fine. On the OS X side, I've given the shared folder 777 permissions as well, but no dice...any ideas? Update I've found that the number of times I need to refresh before it works is not random - it has to do with how many assets are being compiled. For example, if I edit one of my CSS files, and there are four CSS files in the app/assets/stylesheets directory, I have to refresh four times before the app will finally work without the operation not permitted error...

    Read the article

  • Rails 2 and Ngnix: https pages can't load css or js (but will load graphics)

    - by Max Williams
    ADMISSION: i've posted this same question on stackoverflow, before realising it's probabaly better suited to superuser, but it kind of depends on the answer: If it turns out to be a problem in my nginx config, it's definitely superuser. If it turns out to be a problem in my Rails config (or code) then it's arguably stackoverflow. I'm adding some https pages to my rails site. In order to test it locally, i'm running my site under one mongrel_rails instance (on 3000) and nginx. I've managed to get my nginx config to the point where i can actually go to the https pages, and they load. Except, the javascript and css files all fail to load: looking in the Network tab in chrome web tools, i can see that it is trying to load them via an https url. Eg, one of the non-working file urls is https://cmw-local.co.uk/stylesheets/cmw-logged-out.css?1383759216 I have these set up (or at least think i do) in my nginx config to redirect to the http versions of the static files. This seems to be working for graphics, but not for css and js files. If i click on this in the Network tab, it takes me to the above url, which redirects to the http version. So, the redirect seems to be working in some sense, but not when they're loaded by an https page. Like i say, i thought i had this covered in the second try_files directive in my config below, but maybe not. Can anyone see what i'm doing wrong? thanks, Max Here's my nginx config - sorry it's a bit lengthy! I think the error is likely to be in the first (ssl) server block: server { listen 443 ssl; keepalive_timeout 70; ssl_certificate /home/max/work/charanga/elearn_container/elearn/config/nginx/certs/max-local-server.crt; ssl_certificate_key /home/max/work/charanga/elearn_container/elearn/config/nginx/certs/max-local-server.key; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_protocols SSLv3 TLSv1; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; server_name elearning.dev cmw-dev.co.uk cmw-dev.com cmw-nginx.co.uk cmw-local.co.uk; root /home/max/work/charanga/elearn_container/elearn; # ensure that we serve css, js, other statics when requested # as SSL, but if the files don't exist (i.e. any non /basket controller) # then redirect to the non-https version location / { try_files $uri @non-ssl-redirect; } # securely serve everything under /basket (/basket/checkout etc) # we need general too, because of the email/username checking location ~ ^/(basket|general|cmw/account/check_username_availability) { # make sure cached copies are revalidated once they're stale add_header Cache-Control "public, must-revalidate, proxy-revalidate"; # this serves Rails static files that exist without running # other rewrite tests try_files $uri @rails-ssl; expires 1h; } location @non-ssl-redirect { return 301 http://$host$request_uri; } location @rails-ssl { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_read_timeout 180; proxy_next_upstream off; proxy_pass http://127.0.0.1:3000; expires 0d; } } #upstream elrs { # server 127.0.0.1:3000; #} server { listen 80; server_name elearning.dev cmw-dev.co.uk cmw-dev.com cmw-nginx.co.uk cmw-local.co.uk; root /home/max/work/charanga/elearn_container/elearn; access_log /home/max/work/charanga/elearn_container/elearn/log/access.log; error_log /home/max/work/charanga/elearn_container/elearn/log/error.log debug; client_max_body_size 50M; index index.html index.htm; # gzip html, css & javascript, but don't gzip javascript for pre-SP2 MSIE6 (i.e. those *without* SV1 in their user-agent string) gzip on; gzip_http_version 1.1; gzip_vary on; gzip_comp_level 6; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; #text/html # make sure gzip does not lose large gzipped js or css files # see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl gzip_buffers 16 8k; # Disable gzip for certain browsers. #gzip_disable "MSIE [1-6].(?!.*SV1)"; gzip_disable "MSIE [1-6]"; # blank gif like it's 1995 location = /images/blank.gif { empty_gif; } # don't serve files beginning with dots location ~ /\. { access_log off; log_not_found off; deny all; } # we don't care if these are missing location = /robots.txt { log_not_found off; } location = /favicon.ico { log_not_found off; } location ~ affiliate.xml { log_not_found off; } location ~ copyright.xml { log_not_found off; } # convert urls with multiple slashes to a single / if ($request ~ /+ ) { rewrite ^(/)+(.*) /$2 break; } # X-Accel-Redirect # Don't tie up mongrels with serving the lesson zips or exes, let Nginx do it instead location /zips { internal; root /var/www/apps/e_learning_resource/shared/assets; } location /tmp { internal; root /; } location /mnt{ root /; } # resource library thumbnails should be served as usual location ~ ^/resource_library/.*/*thumbnail.jpg$ { if (!-f $request_filename) { rewrite ^(.*)$ /images/no-thumb.png break; } expires 1m; } # don't make Rails generate the dynamic routes to the dcr and swf, we'll do it here location ~ "lesson viewer.dcr" { rewrite ^(.*)$ "/assets/players/lesson viewer.dcr" break; } # we need this rule so we don't serve the older lessonviewer when the rule below is matched location = /assets/players/virgin_lesson_viewer/_cha5513/lessonViewer.swf { rewrite ^(.*)$ /assets/players/virgin_lesson_viewer/_cha5513/lessonViewer.swf break; } location ~ v6lessonViewer.swf { rewrite ^(.*)$ /assets/players/v6lessonViewer.swf break; } location ~ lessonViewer.swf { rewrite ^(.*)$ /assets/players/lessonViewer.swf break; } location ~ lgn111.dat { empty_gif; } # try to get autocomplete school names from memcache first, then # fallback to rails when we can't location /schools/autocomplete { set $memcached_key $uri?q=$arg_q; memcached_pass 127.0.0.1:11211; default_type text/html; error_page 404 =200 @rails; # 404 not really! Hand off to rails } location / { # make sure cached copies are revalidated once they're stale add_header Cache-Control "public, must-revalidate, proxy-revalidate"; # this serves Rails static files that exist without running other rewrite tests try_files $uri @rails; expires 1h; } location @rails { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_read_timeout 180; proxy_next_upstream off; proxy_pass http://127.0.0.1:3000; expires 0d; } }

    Read the article

  • Can't create admin user on Heroku

    - by Nick5a1
    I am new to rails and I have gone through Kevin Skoglund's Ruby on Rails 3 Essential Training course on Lynda.com. Through the course you set up a simple cms, which I did. It doesn't cover Git or deployment but I've pushed my simple cms to github (https://github.com/nick5a1/Simple_CMS) and deployed to Heroku (http://nkarrasch.herokuapp.com/). In order to deploy to Heroku I followed the Heroku setup guide (https://devcenter.heroku.com/articles/rails3) and switched my database from MySQL to PostgreSQL. As instructed I changed gen'mysql2' to gen 'sqlite3' in my Gemfile and ran bundle install before pushing. I then ran heroku run rake db:migrate. I'm running into 2 problems. When I try to log in (http://nkarrasch.herokuapp.com/access) I get an error "We're sorry, but something went wrong". I should instead be getting a flash message with invalid username/password combination. This is what I'm getting on my test environment on my local machine. Secondly, when I log into the Heroku console to create and create an admin user, when I try to save that user I get the following error: irb(main):004:0> user.save (1.2ms) BEGIN AdminUser Exists (1.9ms) SELECT 1 AS one FROM "admin_users" WHERE "admin_users"."username" = 'Nick5a1' LIMIT 1 (1.7ms) ROLLBACK => false Any advice on how to troubleshoot would be greatly appreciated :). Thanks very much, Nick EDIT: Here are my Heroku logs: 2012-06-27T20:36:44+00:00 heroku[slugc]: Slug compilation started 2012-06-27T20:37:34+00:00 heroku[api]: Add shared-database:5mb add-on by [email protected] 2012-06-27T20:37:34+00:00 heroku[api]: Release v2 created by [email protected] 2012-06-27T20:37:34+00:00 heroku[api]: Add RAILS_ENV, LANG, PATH, RACK_ENV, GEM_PATH config by [email protected] 2012-06-27T20:37:34+00:00 heroku[api]: Release v3 created by [email protected] 2012-06-27T20:37:34+00:00 heroku[api]: Release v4 created by [email protected] 2012-06-27T20:37:34+00:00 heroku[api]: Deploy 1d82839 by [email protected] 2012-06-27T20:37:35+00:00 heroku[slugc]: Slug compilation finished 2012-06-27T20:37:36+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 45450` 2012-06-27T20:37:40+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 2012-06-27T20:37:40+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 2012-06-27T20:37:40+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 2012-06-27T20:37:44+00:00 app[web.1]: => Rails 3.2.6 application starting in production on http://0.0.0.0:45450 2012-06-27T20:37:44+00:00 app[web.1]: => Call with -d to detach 2012-06-27T20:37:44+00:00 app[web.1]: => Booting WEBrick 2012-06-27T20:37:44+00:00 app[web.1]: Connecting to database specified by DATABASE_URL 2012-06-27T20:37:44+00:00 app[web.1]: => Ctrl-C to shutdown server 2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO WEBrick 1.3.1 2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] 2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO WEBrick::HTTPServer#start: pid=2 port=45450 2012-06-27T20:37:45+00:00 heroku[web.1]: State changed from starting to up 2012-06-27T20:39:44+00:00 heroku[run.1]: Awaiting client 2012-06-27T20:39:44+00:00 heroku[run.1]: Starting process with command `bundle exec rake db:migrate` 2012-06-27T20:39:44+00:00 heroku[run.1]: State changed from starting to up 2012-06-27T20:39:51+00:00 heroku[run.1]: Process exited with status 0 2012-06-27T20:39:51+00:00 heroku[run.1]: State changed from up to complete 2012-06-27T20:41:05+00:00 heroku[run.1]: Awaiting client 2012-06-27T20:41:05+00:00 heroku[run.1]: Starting process with command `bundle exec rails console` 2012-06-27T20:41:05+00:00 heroku[run.1]: State changed from starting to up 2012-06-27T20:46:09+00:00 heroku[run.1]: Process exited with status 0 2012-06-27T20:46:09+00:00 heroku[run.1]: State changed from up to complete

    Read the article

  • Rails Tutorial Error with gemspec for "rspec" "annotate" "spork" "ansicolor" [closed]

    - by Chris H
    I'm following the Rails Tutorial by Michael Hartl and I'm getting this error when I run. bundle exec rspec spec/requests/static_pages_spec.rb Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/annotate-2.4.1.beta1.gemspec]: invalid date format in specification: "2011-09-02 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-rspec-0.5.5.gemspec]: invalid date format in specification: "2011-11-20 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-spork-0.3.2.gemspec]: invalid date format in specification: "2011-11-18 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/spork-0.9.0.gemspec]: invalid date format in specification: "2012-01-22 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/annotate-2.4.1.beta1.gemspec]: invalid date format in specification: "2011-09-02 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-rspec-0.5.5.gemspec]: invalid date format in specification: "2011-11-20 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-spork-0.3.2.gemspec]: invalid date format in specification: "2011-11-18 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/spork-0.9.0.gemspec]: invalid date format in specification: "2012-01-22 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/annotate-2.4.1.beta1.gemspec]: invalid date format in specification: "2011-09-02 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-rspec-0.5.5.gemspec]: invalid date format in specification: "2011-11-20 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-spork-0.3.2.gemspec]: invalid date format in specification: "2011-11-18 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/spork-0.9.0.gemspec]: invalid date format in specification: "2012-01-22 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/annotate-2.4.1.beta1.gemspec]: invalid date format in specification: "2011-09-02 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-rspec-0.5.5.gemspec]: invalid date format in specification: "2011-11-20 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-spork-0.3.2.gemspec]: invalid date format in specification: "2011-11-18 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/spork-0.9.0.gemspec]: invalid date format in specification: "2012-01-22 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z" /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load': cannot load such file -- /Users/chrishuang02/Desktop/rails_projects/first_app/spec/requests/spec/requests/static_pages_spec.rb (LoadError) from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'

    Read the article

  • I Can't Get Ruby on Rails + Passenger + Apache to Work

    - by Luke Crowe
    I'm sorry if this is a stupid question, but I can't get Ruby on Rails to work on my Apache server. I'm using Phusion Passenger (mod_rails, mod_rack) for app deployment. Here is my RoR-specific configuration code in my website's Apache configuration file: Alias /rails /var/www/syyborg.com/ruby/blog/public <Directory /var/www/syyborg.com/ruby/blog/public Options FollowSymLinks AllowOverride None Order Allow,Deny Allow from All </Directory RailsBaseURI /rails Again, I really have very little knowledge of this kind of thing; I have never set up a server from scratch before. Anyways, my rails app, as you can see, is located at /var/www/syyborg.com/ruby/blog/. I am trying to access it from http://[my domain, syyborg.com]/rails. However, when I try to load the site, I get a "403 Forbidden" error. Any help would be greatly appreciated, and I can provide further details if they are required. Thanks in advance!

    Read the article

  • How do I configure Ruby On Rails on windows XP with APACHE and MYSQL

    - by Gaurav Sharma
    Hello Everyone, It has been quite some time I am struggling to get Ruby On Rails working on my System which is having Windows XP operating system. I am trying to configure ROR to use apache and mysql so that I do not have to install additional servers to run ruby on rails. I also tried InstantRails but faced same problems. I went through the tutorial mentioned in getting rails to wrok on a windows machine running xampp and did all the steps which were necessary. All went fine (installing rails, running the ruby, gem and rails command from command prompt) but when I tried to run my application by typing localhost:3000/say/hello nothing happened and I was redirected to the google page for searching to this keyword. Please help me Thanks

    Read the article

  • Configuring Nginx for Wordpress and Rails

    - by Michael Buckbee
    I'm trying to setup a single website (domain) that contains both a front end Wordpress installation and a single directory Ruby on Rails application. I can get either one to work successfully on their own, but can't sort out the configuration that would let me coexist. The following is my best attempt, but it results in all rails requests being picked up by the try_files block and redirected to "/". server { listen 80; server_name www.flickscanapp.com; root /var/www/flickscansite; index index.php; try_files $uri $uri/ /index.php; location ~ \.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/flickscansite$fastcgi_script_name; } passenger_enabled on; passenger_base_uri /rails; } An example request of the Rails app would be http://www.flickscan.com/rails/movies/upc/025192395925

    Read the article

  • Install Rails on linux [migrated]

    - by Jseb
    I am trying to install Ruby on Rails. and i have followed the following link for the install https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm. This link was helpful i was able to run it, and everything, however as soon has i restarted the computer i then go into my apps and run it again with rails s and this message occurs. The program 'rails' is currently not installed. You can install it by typing: sudo apt-get install rails But work before, what should i do, do i need to set the path of somesort?? I am not that great in linux so bear with me. I am using linux ubuntu 12.04 desktop and my user is john Thanks in advance

    Read the article

  • Rails. How to extend controller class from plugin without any modification in controller file?

    - by potapuff
    I'm use Rails 2.2.2. Rails manual said, the way to extend controller from plug-in is: Plugin: module Plug def self.included(base) base.extend ClassMethods base.send :include, InstanceMethods base.helper JumpLinksHelper end module InstanceMethods def new_controller_metod ... end end module ClassMethods end end app/controller/name_controller.rb class NameController < ApplicationController include Plug ... end Question: is any way to extend controller from plug-in, without any modification of controller file, if we know controller name.

    Read the article

  • How can this C and PHP programmer learn Ruby and Rails?

    - by Winston
    I came from a C, php and bash background, it was easy to learn because they all have the same C structure, which I can associate with what I already know. Then 2 years ago I learned Python and I learned it quite well, Python is easier for me to learn than Ruby. Then since last year, I was trying to learn Ruby, then Rails, and I admit, until now I still couldn't get it, the irony is that those are branded as easy to learn, but for a seasoned programmer like me, I just couldn't associate it with what I learned before, I have 2 books on both Ruby and Rails, and when I'm reading it nothing is absorbed into my mind, and I'm close to giving up... In ruby, I'm having a hard time grasping the concepts of blocks, and why there's @variables that can be accessed by other functions, and what does $variable and :variable do? And in Rails, why there's function like this_is_another_function_that_do_this, so thus ruby, is it just a naming convention or it's auto-generated with thisvariable _can_do_this_function. I'm still puzzled that where all those magic concepts and things came from? And now, 1 year of trying and absorbing, but still no progress... Edit: To summarize: How can I learn about blocks, and how can it be related to concepts from PHP/C? Variables, what does does it mean when a variable is prefixed with: @ $ : "Magic concepts", suchs as rails declarations of Records, what happens behind the scenes when I write has_one X OK so, bear with me with my confusion, at least I'm honest with myself, and it's over a year now since I first trying to learn ruby, and I'm not getting younger.. so I learned this in Bash/C/PHP solve_problem($problem) { if [ -e $problem == "trivial" ]; then write_solution(); else breakdown_problem_into_N_subproblems(\; define_relationship_between_subproblems; for i in $( command $each_subproblem ); do solve_problem $i done fi } write_solution(problem) { some_solution=$(command <parameters> "input" | command); command | command $some_solution > output_solved_problem_to_file } breakdown_problem_into_N_subproblems($problems) { for i in $problems; do command $i | command > i_can_output_a_file_right_away done } define_relationship_between_subproblems($problems) { if [ -e $problem == "relationship" ]; then relationship=$(command; command | command; command;) elsif [ -e $problem == "another_relationship" ]; relationship=$(command; command | command; command;) fi } In C/PHP is something like this solve_problem(problem) { if (problem == trivial) write_solution; else { breakdown_problem_into_N_subproblems; define_relationship_between_subproblems; for (each_subproblem) solve_problems(subproblem); } } And now, I just couldn't connect the dots with Ruby, |b|{ blocks }, using @variables, :variables, and variables_with_this_things..

    Read the article

  • Rails Plugins Load Path - I have ActiveRecord Models in a Plugin, How do I load them without Namespa

    - by viatropos
    I have a bunch of models for Oauth services, things like: TwitterToken GoogleToken There are OAuth versions and OpenID versions for some, so I decided to logically organize my gem like so: lib lib/my-auth-gem lib/my-auth-gem/oauth lib/my-auth-gem/oauth/tokens/google_token ... lib/my-auth-gem/openid/tokens/google_token ... I would like to be able to name my models GoogleToken, rather than MyAuthGem::Oauth::Tokens::GoogleToken. How do I do that? This will be for Rails 2.3+ and Rails 3.

    Read the article

  • Uploadify with ruby on rails 'bad content body' 500 Internal Server Error

    - by Mr_Nizzle
    I'm Getting this error in my development log while uploadify is uploading the file and in the view i get an 'IO ERROR' beside filename. /!\ FAILSAFE /!\ Thu Mar 18 11:54:53 -0500 2010 Status: 500 Internal Server Error bad content body /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/utils.rb:351:in `parse_multipart' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/utils.rb:323:in `loop' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/utils.rb:323:in `parse_multipart' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/request.rb:133:in `POST' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_controller/params_parser.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_controller/session/cookie_store.rb:93:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_controller/reloader.rb:29:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_controller/failsafe.rb:26:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_controller/dispatcher.rb:106:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/fastcgi.rb:58:in `serve' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:103:in `process_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:153:in `with_signal_handler' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:101:in `process_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:78:in `process_each_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:77:in `each' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:77:in `process_each_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:76:in `catch' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:76:in `process_each_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:51:in `process!' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:23:in `process!' dispatch.fcgi:24 any idea on this?

    Read the article

  • Rails.cache throws "marshal dump" error when changed from memory store to memcached store

    - by gsmendoza
    If I set this in my environment config.action_controller.cache_store = :mem_cache_store ActionController::Base.cache_store will use a memcached store but Rails.cache will use a memory store instead: $ ./script/console >> ActionController::Base.cache_store => #<ActiveSupport::Cache::MemCacheStore:0xb6eb4bbc @data=<MemCache: 1 servers, ns: nil, ro: false>> >> Rails.cache => #<ActiveSupport::Cache::MemoryStore:0xb78b5e54 @data={}> In my app, I use Rails.cache.fetch(key){ object } to cache objects inside my helpers. All this time, I assumed that Rails.cache uses the memcached store so I'm surprised that it uses memory store. If I change the cache_store setting in my environment to config.cache_store = :mem_cache_store both ActionController::Base.cache_store and Rails.cache will now use the same memory store, which is what I expect: $ ./script/console >> ActionController::Base.cache_store => #<ActiveSupport::Cache::MemCacheStore:0xb7b8e928 @data=<MemCache: 1 servers, ns: nil, ro: false>, @middleware=#<Class:0xb7b73d44>, @thread_local_key=:active_support_cache_mem_cache_store_local_cache> >> Rails.cache => #<ActiveSupport::Cache::MemCacheStore:0xb7b8e928 @data=<MemCache: 1 servers, ns: nil, ro: false>, @middleware=#<Class:0xb7b73d44>, @thread_local_key=:active_support_cache_mem_cache_store_local_cache> However, when I run the app, I get a "marshal dump" error in the line where I call Rails.cache.fetch(key){ object } no marshal_dump is defined for class Proc Extracted source (around line #1): 1: Rails.cache.fetch(fragment_cache_key(...), :expires_in => 15.minutes) { ... } vendor/gems/memcache-client-1.8.1/lib/memcache.rb:359:in 'dump' vendor/gems/memcache-client-1.8.1/lib/memcache.rb:359:in 'set_without_newrelic_trace' What gives? Is Rails.cache meant to be a memory store? Should I call controller.cache_store.fetch in the places where I call Rails.cache.fetch?

    Read the article

  • Installing Rails, MySQL, etc. everything goes wrong

    - by Rits
    I've been struggling with this for a few hours. Everything just stopped working and I can't get it to work anymore. I'm a noob at Ruby, Ruby on Rails and the Terminal in general. This is really frustrating me so I just try to describe my problem as detailed as possible hoping someone can give me a solution. I'm on Mac OS X Snow Leopard. I couldn't get Rails working at all just now: Could not find gem 'rails' headaches But after some tries of reinstalling it, it suddenly worked again. But now I just can't get MySQL to work, and it sometimes even breaks the Rails installation again. This is what I do: sudo gem uninstall rails sudo gem uninstall mysql sudo gem uninstall mysql2 After these commands, I check the installed gems with gem list. No MySQL gem is listed anymore, but I can still see rails (2.3.5, 2.2.2, 1.2.6) . Is this normal? Does this mean I have 3 Rails installations? It doesn't make sense to me. Anyway, then I do this: sudo gem clean Which fails completely. I get a bunch of errors like this: Attempting to uninstall fcgi-0.8.7 Unable to uninstall fcgi-0.8.7: Gem::InstallError: cannot uninstall, check gem list -d fcgi It doesn't uninstall anything. At this point, I try to install everything again. I start with: sudo gem install rails Which succeeds (I think): Successfully installed rails-3.0.3 Successfully installed builder-2.1.2 2 gems installed Installing ri documentation for rails-3.0.3... File not found: lib Then, I update RubyGems: sudo gem update --system sudo gem install rubygems-update sudo update_rubygems Then it says I have 1.3.7 installed, so it succeeded, I think. So now I proceed with installing MySQL. I already got MySQL 5.5.8 installed on my machine. I did some research about installing MySQL on Snow Leopard, and it seems I have to use this command: sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config I get a bunch of errors like this: No definition for time_set_neg No definition for time_set_second_part No definition for time_equal No definition for error_errno At this point, I assume I got both Rails and the MySQL gem installed, so I try to start a new project. rails new user_group -d mysql It works! Rails is installed correctly. Now, I try generating a model. cd user_group rails generate model User It fails with this error: Could not find gem 'mysql2 (= 0, runtime)' in any of the gem sources listed in your Gemfile. Try running bundle install. So I try running bundle install. It installs a lot of gems. Then I try to generate my model again. I get this error: Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.16.dylib (LoadError) Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle This is as far as I can get. What should I do? And why should this be so hard...

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >