Search Results

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

Page 127/378 | < Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >

  • How can I set the Rails environment for my somewhat stand alone Ruby script?

    - by Nick
    I have a Ruby script in my Rails app that I use to load some data from Twitter. In the future I will make it an automatic background process, but for now I run it manually like: ruby /lib/twitter/twitterLoad.rb In order to use the Rails model classes and such, I have the following as the top line of the script: require "#{File.dirname(__FILE__)}/../../config/environment.rb" By default, the development environment is used. But, I'd like to be able to choose the production environment at some point. Update #1: The RAILS_ENV constant is getting set in the environment.rb file. So, I was able to put ENV['RAILS_ENV'] = 'production' at the very top (before the environment.rb) line and solve my problem somewhat. So, my new question is, can do pass in env vars through the command line?

    Read the article

  • Could not find generator mini_test:install

    - by David James
    I expected these generators to be available: $ rails g Usage: rails generate GENERATOR [args] [options] MiniTest: mini_test:controller mini_test:helper mini_test:install mini_test:mailer mini_test:model mini_test:scaffold So I ran: $ rails g mini_test:install But got this error: Could not find generator mini_test:install. As for my environment, here is the relevant portion of my Gemfile: group :test, :development do gem 'minitest-rails' end And the resulting portions of my Gemfile.lock: minitest (2.12.1) minitest-rails (0.0.7) minitest (~> 2.12) rails (~> 3.1) I am now in the process of debugging this. I would appreciate any tips. In any case, I will report back.

    Read the article

  • In Rails, what could cause a user to have another user's session?

    - by DavidNorth
    I have a Rails application using with an authentication system using Restful Authentication without any modification. Users have reported finding themselves logged in as the wrong user. In at least one case it was on their very first page view, never having logged in before. Is it possible their session ids are getting mixed up? Would switching to CookieStore make it impossible for this to happen since no session data is stored on the server this way? I suspect the problem is related to Passenger but I don't know where to start debugging this. Its only happened about 4 times in several months of being live so its virtually impossible to reproduce. Environment: ActiveRecord session storage Rails 2.2.2 Passenger 2.0.1 Apache 2 Ruby 1.8.6 Many thanks

    Read the article

  • Has anyone used a rails gem for lightbox functionality? If so which ones?

    - by bgadoci
    Trying to figure out what is the best solution for using lightbox in rails. I have a set up an application that has projects and posts belong_to project. A post can have multiple photos and I am successfully only displaying the first photo in the photos table in the projects show view for each post. I am now trying to allow the user to view the rest of the photos associated with a post through a lightbox feature. Any idea if there is a rails ready solution for something like this?

    Read the article

  • Using Rails, how can I set my primary key to not be an integer-typed column?

    - by Rudd Zwolinski
    I'm using Rails migrations to manage a database schema, and I'm creating a simple table where I'd like to use a non-integer value as the primary key (in particular, a string). To abstract away from my problem, let's say there's a table employees where employees are identified by an alphanumeric string, e.g. "134SNW". I've tried creating the table in a migration like this: create_table :employees, {:primary_key => :emp_id} do |t| t.string :emp_id t.string :first_name t.string :last_name end What this gives me is what seems like it completely ignored the line t.string :emp_id and went ahead and made it an integer column. Is there some other way to have rails generate the PRIMARY_KEY constraint (I'm using PostgreSQL) for me, without having to write the SQL in an execute call? NOTE: I know it's not best to use string columns as primary keys, so please no answers just saying to add an integer primary key. I may add one anyway, but this question is still valid.

    Read the article

  • why assert_equal() in Ruby on Rails sometimes seem to compare by Identity and sometimes by value?

    - by Jian Lin
    it was very weird that yesterday, I was do an integration test in Rails and assert_equal array_of_obj1, array_of_obj2 # obj1 from db, obj2 created in test and it failed. The values shown inside the array and objects were identical. If I change the test to assert array_of_obj1 == array_of_obj2 Then it will pass. But today, the first test actually passed. What reason could it be? Is assert_equal always using == or .equal? in Rails 2.2 or 2.3.5?

    Read the article

  • Rails 2.3.5: How does one access code inside of lib/directory/file.rb?

    - by randombits
    I created a file so I can share a method amongst many models in lib/foo/bar_woo.rb. Inside of bar_woo.rb I defined the following: module BarWoo def hello puts "hello" end end Then in my model I'm doing something like: def MyModel < ActiveRecord::Base include Foo::BarWoo def some_method Foo::BarWoo.hello end end The interpreter is complaining that it expected bar_woo.rb to define Foo::BarWoo. The Agile Web Development with Rails book states that if files contain classes or modules and the files are named using the lowercase form of the class or module name, then Rails will load the file automatically. I didn't require it because of this.

    Read the article

  • Sinatra as backend (API) for Rails app or padrino or any hybrid solution?

    - by JVK
    Is it a good idea to build backend APIs in Sinatra for Rails app. Or is it better to use Padrino? I want to have my backend provides API as service, so that anytime, if I have to develop same app for any client, I can use that back-end API (web services). What is the best approach? My goal is to expose back-end as web services and even rails uses it for webapp. What are the disadvantages or advantage of different approaches?

    Read the article

  • Can you recommend an in-browser Ruby/Rails 3D renderer?

    - by mohawkjohn
    I want to draw some 3D network diagrams in a web browser, and the data for these diagrams are in a Rails app (in the database). I already use flotomatic as a Rails interface for pretty Javascript plots (e.g., independent variable, dependent variable). Certainly there are packages for drawing simple things in Javascript. What I'm looking for is (a) a Javascript package for 3D drawings that are displayed in a web browser (without a plugin), and (b) a Ruby API for that package, if possible. Any recommendations? Many thanks!

    Read the article

  • Is there a Ruby on Rails framework like equivalent for .NET development?

    - by wgpubs
    Answers like ASP.NET MVC or Entity Framework really aren't acceptable as they address just one aspect of the problem domain. I'm looking for a framework ... a REAL framework that gives me the same features out of the box that Rails does. As such it should include at minimum: MVC for presentation ORM Ability to provide simple configuration for whatever environment (dev, QA, Production, etc...) Migration like functionality Ability to generate code in all layers (similar to scaffolding like behavior, etc...) Project template so as to create similar functionality as the "rails my_app" command. Thanks.

    Read the article

  • When open-sourcing a live Rails app, is it dangerous to leave the session key secret in source contr

    - by rspeicher
    I've got a Rails app that's been running live for some time, and I'm planning to open source it in the near future. I'm wondering how dangerous it is to leave the session key store secret in source control while the app is live. If it's dangerous, how do people usually handle this problem? I'd guess that it's easiest to just move the string to a text file that's ignored by the SCM, and read it in later. Just for clarity, I'm talking about this: # Your secret key for verifying cookie session data integrity. # If you change this key, all old sessions will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. ActionController::Base.session = { :key => '_application_session', :secret => '(long, unique string)' } And while we're on the subject, is there anything else in a default Rails app that should be protected when open sourcing a live app?

    Read the article

  • How can I remove Ruby, Rails & mysql to start the installation process again?

    - by ben
    I've been trying to get setup with Ruby on Rails today, but I think I've followed some bad instructions along the way, and nothing seems to work. I've now borrowed the book "Agile Web Development with Rails, Third Edition" from a friend, and want to follow the setup instructions in that. Firstly, do I need to remove what I've setup previously? If yes, how do I do it? I can't seem to find instructions anywhere. I'm running OSX 10.6.1, so I know that it came with some stuff already setup, but I've been installing customized stuff over the top which I think I'll have to remove. Thanks for reading!

    Read the article

  • Newbie: get access privilege

    - by Mellon
    I am newbie on Linux Ubuntu machine. I logged in to the Ubuntu with username: student. There are some directories only allowed root user to access, for example /var/lib/mysql ,(I know I can use sudo to access but it is not what I want). If I want to get the access privilege on those directories with student account, is it so that I can run the following command : chown student: PATH_TO_ROOT_USER_PRIVILEGED_DIR and after that, I can access that directory by using my own account ? am I right? If I am right, then will root user lose the access privilege because I changed it to student user? If I am wrong, please tell me the right solution. P.S. please don't concern on what I am going to do on /var/lib/mysql directory, that is only my example, as I mentioned above, I mean generally *for those directories which only have root privilege*, can I use chown to change access privilege and will root user then loose the access because of the change made by chown ? I just wanna know the effect of chown.

    Read the article

  • IRC newbie needs detailed "How To" directions for freenode.net connection with OS X IRC app

    - by Johnny Utahh
    Newbie IRC user here. Trying to get connected on freenode.net, preferably with a native Mac OS X client (I'm running 10.6.8), or at least something with a good "OS X feel." Also seeking a client that comes "well regarded" in Mac community (eg, Linkinus reflects outstanding Apple App Store user ratings). Thus far have found it remarkably difficult to "get started from scratch" with ANY client. All attempted clients (Colloquy, Textual, Linkinus) experience some sort of "* Notice -- You need to identify via SASL to use this server" error. I see this freenode SASL-friendly client list; am I really limited to only these clients? This "IRC-freenode startup" procedure has been far more difficult than I had originally anticipated. Why can't I just do this and have it "just work"? Bottom line: looking for a "chapter and verse"/cookbook description of how to get started with freenode.net IRC chat rooms on Mac OS. Need reference to known-working client, and then exact directions on how to get connected to a chat room with a nickname.

    Read the article

  • newbie: Allow domain users to change power-savings settings

    - by user65007
    I've just recently installed SMS 2011 on a server and added several computers to it's domain. Now I've noticed that I cannot change power settings (even when logged in as user who is in Domain Administrator role, let's call it Admin for future reference). After some googling I ended up adding Admin to the local administrators group using Group Policy Management Editor (as I have no experience in server administration I'm not sure I did it right: I went to Policy Management, selected Forest: xxxxx - Domains - xxxxx - Group Policy Objects - Windows SBS Client - Windows 7 and Windows Vista Policy - go to Settings tab on the right and right-click on anything and select Edit to go to Group Policy Mangement Editor - User Configuration - Preferences - Control Panel Settings - Local Users and Groups - right-click on it and select New - Local Group, then set Action to "Update", Group Name to "Administrators (built-in)", and added Admin to Members). After that I was able to change the power-savings settings on client computers(when logged in as Admin). Now the question: what should I do to allow any domain user to change this settings? Notice, I do not want to force some predefined power plan to all computers, I want to set it up so that any domain user on any client computer would be able to select a different power plan and to make any adjustments to the selected one. Thank you for any suggestions, just keep in mind that I'm newbie (but not completely dumb), so please answer accordingly :)

    Read the article

  • error while running ruby application at system startup in ubuntu

    - by anjo
    I am on Ubuntu 12.04 machine. Have a script file which runs when entered manually in terminal gnome-terminal -e /home/precise/Desktop/cartodb/script.sh The content of script file is cd /home/ubuntupc/Desktop/cartodb20/ sh /home/ubuntupc/.rvm/scripts/rvm bundle exec foreman start -p 3000 So what i tried to do is to run this script at every system start up. So on Startup Applications command: gnome-terminal -e /home/precise/Desktop/cartodb/script.sh On terminal Edit - Profile Preferences - Title and Command Checked the "Run command as a login shell" But this seems to be not working. When restarted the machine found these error in terminal The child process exited normally with status 127. ERROR: RVM Ruby not used, run `rvm use ruby` first. Some info regarding the installed packages and system. $ which ruby /home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/ruby $ which rails /home/ubuntupc/.rvm/gems/ruby-1.9.2-p320/bin/rails $ which gem /home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/gem $ cat ~/.bash_profile [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* $ which -a ruby /home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/ruby $ sudo update-alternatives --config ruby update-alternatives: error: no alternatives for ruby. $ sudo find / -name "rubygems" -print /home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems /home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rubygems /home/ubuntupc/.rvm/src/ruby-1.9.2-p320/lib/rubygems /home/ubuntupc/.rvm/src/ruby-1.9.2-p320/test/rubygems /home/ubuntupc/.rvm/src/ruby-1.9.2-p320/test/rubygems/rubygems /home/ubuntupc/.rvm/src/ruby-1.9.2-p320/doc/rubygems /home/ubuntupc/.rvm/src/rubygems-2.2.1/lib/rubygems /home/ubuntupc/.rvm/src/rubygems-2.2.1/test/rubygems /home/ubuntupc/.rvm/src/rubygems-2.2.1/test/rubygems/rubygems /home/ubuntupc/.rvm/src/rvm/scripts/functions/rubygems /home/ubuntupc/.rvm/src/rvm/scripts/rubygems /home/ubuntupc/.rvm/scripts/functions/rubygems /home/ubuntupc/.rvm/scripts/rubygems /usr/lib/ruby/1.9.1/rubygems /usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems /usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rubygems /usr/local/rvm/src/ruby-1.9.2-p320/lib/rubygems /usr/local/rvm/src/ruby-1.9.2-p320/test/rubygems /usr/local/rvm/src/ruby-1.9.2-p320/test/rubygems/rubygems /usr/local/rvm/src/ruby-1.9.2-p320/doc/rubygems /usr/local/rvm/src/rubygems-2.2.0/lib/rubygems /usr/local/rvm/src/rubygems-2.2.0/test/rubygems /usr/local/rvm/src/rubygems-2.2.0/test/rubygems/rubygems /usr/local/rvm/src/rvm/scripts/functions/rubygems /usr/local/rvm/src/rvm/scripts/rubygems /usr/local/rvm/scripts/functions/rubygems /usr/local/rvm/scripts/rubygems Please point out what i am missing as i am new to the ruby applications. Thanks in advance

    Read the article

  • Ruby freelancing: realistic expectations?

    - by Sophie
    Hi guys, I'm in a situation where I only need $100 to live at a place. How is this relevant to programming? Well, I would like to hear the opinions of those on this site if it is at all realistic to expect a Ruby noobie to be able to make $100 freelancing by a month from now, assuming a great deal of effort and enthusiasm o_O I'm a complete noob to programming ;d, learning Ruby before Rails. (I also asked this on StackOverflow, but want lots of answers so .<)

    Read the article

  • yahoo media player not working.

    - by luca590
    I have a yahoo media player embedded in my webpage. I am currently using Ruby on Rails to create/edit my web page. When i click the play button next to a track the YMP waits a while and then goes to the next track without playing the first one. I then get a warning on my second (last) track that its file could not be found. Does anyone has a better recommendation for an audio player or a way to fix this one?

    Read the article

  • yahoo media player not working

    - by luca590
    I have a yahoo media player embedded in my webpage. I am currently using Ruby on Rails to create/edit my web page. When i click the play button next to a track the YMP waits a while and then goes to the next track without playing the first one. I then get a warning on my second (last) track that its file could not be found. Does anyone has a better recommendation for an audio player or a way to fix this one?

    Read the article

  • Useful links

    - by Madhan ayyasamy
    Difference between STI vs Polymorphic associationsSTI vs PolymorphicDifference between habtm vs has_many :throughhabtm vs throughCapistrano Guide linkCapistrano guideRails application without database stuffclass Car < ActiveRecord::Baseself.abstract = trueendAnother link: rails without databaseNamed scope useful linkNamed scopeDifference between http and https verbhttp vs httpsRails 2.3 useful guide websiterails 2.3 guide

    Read the article

  • Serialized values or separate table, which is more efficient?

    - by Aravind
    I have a Rails model email_condition_string with a word column in it. Now I have another model called request_creation_email_config with the following columns admin_filter_group:references vendor_service:references email_condition_string:references email_condition_string has many request_creation_email_config and request_creation_email_config belongs to email_condition_string. Instead of this model a colleague of mine is suggesting that strong the word inside the same model as comma separated values is efficient than storing as a separate model. Is that alright?

    Read the article

  • nginx with ssl: I get a 403 and log "directory index of '...dir...' is forbidden" log message. works fine with unencrypted connection

    - by user72464
    As mentioned in the title, I had nginx working fine with my rails app, until I tried to add the ssl server. The unencrypted connection still works but the ssl always returns me a 403 page with the following line in the error log: directory index of "/home/user/rails/" is forbidden, client: [my ip], server: _, request: "GET / HTTP/1.1", host: "[server ip]" Below my nginx.conf server block: server { listen 80; listen 443 ssl; ssl_certificate /etc/ssl/server.crt; ssl_certificate_key /etc/ssl/server.key; client_max_body_size 4G; keepalive_timeout 5; root /home/user/rails; try_files $uri/index.html $uri.html $uri @app; location @app { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://0.0.0.0:8080; } error_page 500 502 503 504 /500.html; location = /500.html { root /home/user/rails; } } the /home/user/rails directory and it's parent have all read to all rights. and they belong to the user nginx. the certificate and key file have the following rights: -rw-r--r-- 1 nginx root 830 Nov 8 09:09 server.crt -rw--w---- 1 nginx root 887 Nov 8 09:09 server.key any clue?

    Read the article

  • connection to apache server switches sockets connection

    - by Newben
    I have just post a question but I post an other one because the problem is not the one I had in thought when asking the latter. So, I am running some rails app on osx, when I run rails s, everything works fine. If I shut down the apache server (mamp) and if I run rails s again, I have this message Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock', which for sure is normal. For info, my mamp server is running, and the connection must pass through /Applications/MAMP/Library/bin/mysql, so I aliased it by setting in my bash profile : alias mysql="/Applications/MAMP/Library/bin/mysql" Now, when I launch a rails generate command type, I get this message : /$root/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error) So how it can be ?

    Read the article

< Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >