Search Results

Search found 196 results on 8 pages for 'sinatra'.

Page 7/8 | < Previous Page | 3 4 5 6 7 8  | Next Page >

  • Developing an online email service [closed]

    - by Richard Stokes
    I am interested in developing an online email service (e.g. Gmail, Hotmail, but on a much smaller scale) allowing people to sign up for free email addresses on my domain. The domain in question is already purchased, but I have no idea how to even start. I was hoping to code this using a Ruby framework such as Rails or Sinatra. Firstly, are there any libraries/pre-made solutions to this problem that exist already that would be easy enough to just plug-in to my own site? Secondly, if there are no real pre-made solutions, what are the general steps I need to take to accomplish this task?

    Read the article

  • require 'rubygems'

    - by demas
    I have seen many samples of Ruby code with this line (for example, http://www.sinatrarb.com/). What is purpose of this require? # require 'rubygems' require 'sinatra' get '/hi' do "Hello world!" end In all cases the code works without this line.

    Read the article

  • Something like PPerl for Ruby?

    - by sal
    I've used PPerl for deamon like processes. This program turns ordinary perl scripts into long running daemons, making subsequent executions extremely fast. It forks several processes for each script, allowing many proceses to call the script at once. Does anyone know of something like this for ruby? Right now I am planing on using a wrapper around curl to call a REST WebService written in Sinatra running on JRuby. I'm hoping there is a simpler option.

    Read the article

  • multi-user rvm gem install failure when called from CloudFormation::Init

    - by Peter Mounce
    I've taken an Amazon Linux AMI (based on CentOS) and installed RVM (1.10.3) to it in multi-user fashion (see {1} below). I used that to install ruby 1.9.3-p125, rubygems 1.8.17, and bundler 1.1 as the baseline requirements for most things I'm going to be using the instances for. I've captured that instance to an AMI, and am now launching it via CloudFormation, with some CloudFormation::Init commands. One of them is to use s3cmd to pull down a private gem from S3, and the next one, the one that fails, is to install that gem. It fails with an error message 2012-03-15 16:53:20,201 [ERROR] Command 20_install_gems (/usr/local/rvm/rubies/ruby-1.9.3-p125/bin/gem install ./*.gem) failed 2012-03-15 16:53:20,202 [DEBUG] Command 20_install_gems output: /usr/local/rvm/rubies/ruby-1.9.3-p125/bin/gem:12:in `require': no such file to load -- rubygems (LoadError) from /usr/local/rvm/rubies/ruby-1.9.3-p125/bin/gem:12 Now, that happens during the cfn-init execution - I assume, but haven't checked yet, that cfn-init is being run with an environment different from that of ec2-user (there are no other users on the instance). If I run gem install mygem.gem in an interactive session then that works fine. So, my question really, is what should I do to make this work for cfn-init? Have I correctly set up rvm as multi-user? I've confirmed that cfn-init is being run as the root user, with his restricted environment. How should I source the /etc/profile.d/rvm.sh into root's sessions? {1} My semi-automated rvm installation steps (run in interactive session as ec2-user): sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) sudo gpasswd -a ec2-user rvm # iconv-devel is baked into centos' glibc sudo yum install -y autoconf automake bison bzip2 gcc-c++ git libffi-devel libtool libxml2-devel libxslt-devel libyaml-devel make openssl-devel patch readline readline-devel zlib zlib-devel source /etc/profile.d/rvm.sh rvm list known # in a new session: rvm install ruby-1.9.3-p125 rvm use 1.9.3 --default gem update --system # gems required by public_web-awareness gem install aws-sdk bundler cocaine sinatra echo -e "gem: --no-ri --no-rdoc\n" > /home/ec2-user/.gemrc # delete unnecessary documentation files rm -rf `gem env gemdir`/doc sudo -s sudo echo -e "gem: --no-ri --no-rdoc\n" > /etc/skel/.gemrc sudo echo -e "gem: --no-ri --no-rdoc\n" > /etc/gemrc # ctrl + d out of the sudo session Some environment information: [ec2-user@ip ~]$ echo $PATH /usr/local/rvm/gems/ruby-1.9.3-p125/bin:/usr/local/rvm/gems/ruby-1.9.3-p125@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p125/bin:/usr/local/rvm/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/bin [ec2-user@ip ~]$ echo $GEM_HOME /usr/local/rvm/gems/ruby-1.9.3-p125 [ec2-user@ip ~]$ echo $GEM_PATH /usr/local/rvm/gems/ruby-1.9.3-p125:/usr/local/rvm/gems/ruby-1.9.3-p125@global [ec2-user@ip ~]$ echo $BUNDLE_PATH [ec2-user@ip ~]$ gem list *** LOCAL GEMS *** aws-sdk (1.3.6) bundler (1.1.0) cocaine (0.2.1) httparty (0.8.1) json (1.6.5) multi_json (1.1.0) multi_xml (0.4.1) nokogiri (1.5.1, 1.5.0) rack (1.4.1) rack-protection (1.2.0) rake (0.9.2) sinatra (1.3.2) tilt (1.3.3) uuidtools (2.1.2) yamler (0.1.0)

    Read the article

  • nginx not acknowledging passenger_root option

    - by lowgain
    I'm running a sinatra app on passenger, and trying to hook it to nginx. The relevant part of my config looks like: http { passenger_root /path/to/gem; #this is a valid path passenger_ruby /path/to/ruby; #ditto #etc... server { listen 80; server_name hello.org; root /path/to/stuff/public; passenger_enabled on; } } Whenever I start nginx however, I get: Starting nginx: [alert]: Phusion Passenger is disabled becasue the 'passenger_root' option is not set. Please set this option if you want to enable Phusion Passenger. What am I missing here? Thanks!

    Read the article

  • What are the benefits of running a app server in user space, like Unicorn, as opposed to as sudo?

    - by dan
    I've been using Phusion Passenger + Rails/Sinatra for a lot of projects. Passenger runs under the main Nginx or Apache process. But I'm interested in Unicorn, partly because it runs in user space. You just set up Nginx to proxy_pass requests to a unix socket that is connected to Unicorn processes that you fire up under a normal user account. Is there anything to be said as far as advantages and disadvantages of these two alternative approaches to running an web app? I mean in terms of ease of administration, stability, simplicity, etc.

    Read the article

  • Thin web server - single or multiple instances per IP address:port?

    - by wchrisjohnson
    I'm deploying a rack/sinatra/web socket app onto several servers and will use thin as the web server (http://code.macournoyer.com/thin/). There are almost no views to show, so I am not front-ending it with a traditional web server like Apache or nginx. In general, you see thin started and the underlying config file for it has the number of server instances to start, say 3, and the port to start with, say 5000. So, in my example, when thin starts, it starts up three instances on a range of ports, starting on port 5000. If I have a series of virtual machines, say 3, 6, 9, etc. that I treat as a cluster, would/should I choose to start a single thin instance on each VM, or multiple instances on each VM? Why? Thanks - Chris

    Read the article

  • what does STOP service do in Windows?

    - by Radek
    I start my web server as web service on Windows XP. How it was done is described here My web server is coded in ruby/sinatra and I start it in .bat file. That file is used by the service too. Manually I stop the web server by pressing CTRL+C in the dos window. How can I stop the server now as it started via service? I found out that I can stop it via taskkill /f /t /im ruby.exe Is there any way I can use the MMC stop service function to stop the web server? runweb.bat c: cd C:\web ruby C:\web\web2.rb

    Read the article

  • API Auth vs User Auth

    - by user1626384
    I have read many posts and articles on this topic but still cant connect the dots. I want to make a Rails app that is strictly a JSON API maybe using Sinatra or the rails-api gem. I also want to make both a web client app and an iPhone app which consumes the API. No plans on letting third party dev's use it. So I could create a separate username/password combination for both the web and mobile client and use HTTP Basic over SSL. Each app would have these values as configs in the source and use it to authenticate to the API so only these can make a call. Anyone else trying would get a 401 error returned. This would be considered handling the API authentication. The web and mobile client apps allow end users to sign up and read/write data to the API. When each user is created, I create and save a token in their profile. If a user successfully signs in, I send back the token. On each future read/write then also send along this token in the header. I get the token and lookup the user in the database and make the read/write. Does this sound like an appropriate way to handle it. For the web client, when I initially send back the token, where do I store it. In a cookie? Do I also drop a cookie to handle session state?

    Read the article

  • Is this a secure solution for RESTful authentication?

    - by Chad Johnson
    I need to quickly implement a RESTful authentication system for my JavaScript application to use. I think I understand how it should work, but I just want to double check. Here's what I'm thinking -- what do you guys think? Database schema users id : integer first_name : varchar(50) last_name : varchar(50) password : varchar(32) (MD5 hashed) etc. user_authentications id : integer user_id : integer auth_token : varchar(32) (AES encrypted, with keys outside database) access_token : varchar(32) (AES encrypted, with keys outside database) active : boolean Steps The following happens over SSL. I'm using Sinatra for the API. JavaScript requests authentication via POST to /users/auth/token. The /users/auth/token API method generates an auth_token hash, creates a record in user_authentications, and returns auth_token. JavaScript hashes the user's password and then salts it with auth_token -- SHA(access_token + MD5(password)) POST the user's username and hashed+salted password to /users/auth/authenticate. The /users/auth/authenticate API method will verify that SHA(AES.decrypt(access_token) + user.password) == what was received via POST. The /users/auth/authenticate will generate, AES encrypt, store, and return an access token if verification is successful; otherwise, it will return 401 Unauthorized. For any future requests against the API, JavaScript will include access_token, and the API will find the user account based on that.

    Read the article

  • Tools for modelling data and workflows using structured text files

    - by Alexey
    Consider a case when I want to try some idea of an application. But I want to avoid investing a lot of effort in coding UI/work flows/database schema etc before I see that it's going to be useful to me (as example of potential user). My idea is stay lightweight and put all the data in text files. So the components could be following: Domain objects are represented by text files or their fragments Domain objects are grouped by their type using directories Structure the files using some both human- and machine-friendly format, e.g. YAML Use some smart text editor (e.g. vim, emacs, rubymine) to edit and navigate those files Use color schemes and macros/custom commands of the text editor to effectively manipulate those files Use scripts (or a lightweight web framework like Sinatra) to try some business logic ideas on top of the data model The question is: Are there tools or toolkits that support or can be adopted to this approach? Also any ideas, links to articles/other knowledge sources are very welcome. And more specific question: What is the simplest way to index and update index of files with YAML files?

    Read the article

  • 2011 Tech Goal Review

    - by kerry
    A year ago I wrote a post listing my professional goals for 2011.  I thought I would review them and see how I did. Release an Android app to the marketplace – Didn’t do it.  In fact, haven’t really touched Android much since I wrote that.  I still have some ideas but am not sure if I will get around to it. Contribute free software to the community – I did do this.  I have been collaborating with others via github more lately. Regularly attend a user group meetings outside of Java – Did not do this.  Family life being what it is makes this not that much of a priority right now. Obtain the Oracle Certified Web Developer Certification – Did not do this.  This is not much of a priority to me any more. Learn scala – I am about 50/50 on this one.  I read a few scala books but did not write an actual application. Write an app using JSF – Did not do this.  Still interested. Present at a user group meeting – I did a Maven presentation at the Java user group. Use git more, and more effectively – Definitely did this.  Using it on a daily basis now. Overall, I got about halfway on my goals.  It’s not too bad since I did do a few things that weren’t on my list. Learned to develop applications using GWT and deploy them to Google App Engine Converted one of my sites from PHP to Ruby / Sinatra (learning to use it in the process) Studied up on the HTML 5 features and did a lot of Javascript development

    Read the article

  • Is it correct to say that an ASP .NET MVC application is an HTTPModule?

    - by stormwild
    I just wanted to clarify my understanding of ASP .NET MVC (current version is 4). I was reading this article on How does ASP.NET MVC work? So, how does ASP.NET know how to route requests to MVC? The answer lies in web.config. There is a new http module added to modules collection in ASP.NET MVC projects So basically an mvc application is implemented as an HTTPModule or at least the url routing portion of an mvc app? Would it be possible for one to create and register a custom routing module and then possibly create their own micro mvc framework like Sinatra in Ruby or Slim in PHP?

    Read the article

  • How do I setup a custom Gem.path using JRuby::Rack?

    - by Ben Hogan
    Hi Nick et al, I've been having some fun looking at to source code of JRuby-Rack and Rubygems to try to figure out how to solve a org.jruby.rack.RackInitializationException: no such file to load -- compass in my rackup script cased by require 'compass'. I'm passing in a custom 'gem.path' as a servlet init parameter and it is being correctly picked up by jruby-rack as far as I can tell by debugging in my rackup script: ENV['GEM_PATH'] => '/foo/lib/.jruby/gems' (expected) but rubygems seems to be broken: Gem.path => file:/foo/lib/jruby-complete-1.4.0.jar!/META-INF/jruby.home/lib/ruby/gems/1.8 I'm not sure why rubygems has not adjusted it's gem_path nor the LOAD_PATH, thus breaking require? Thanks again, I'm still a newbie at ruby, jruby, rack and sinatra. Any pointers in the right direction appreciated! Ben

    Read the article

  • Problem with MongoDB Ruby Driver

    - by Paul
    I'm on Ubuntu, and I've done install gem mongo which reported Successfully installed bson-1.0 Successfully installed mongo-1.0 2 gems installed I've started mongod Now I cd to the mongo gem directory and try > ruby examples/simple.rb and I get the error ./examples/../lib/mongo.rb:31:in `require': no such file to load -- bson (LoadError) from ./examples/../lib/mongo.rb:31 from examples/simple.rb:3:in `require' from examples/simple.rb:3 which I can't make sense of, since the bson gem is installed > gem list *** LOCAL GEMS *** bson (1.0) bson_ext (1.0) mongo (1.0) rack (1.1.0) sinatra (1.0) Any suggestions what's up here?

    Read the article

  • In OpenRasta, how do I configure a URI where I get "the remainder of the path" as a single string?

    - by Daniel Earwicker
    Normally in OpenRasta there is some configuration like this: ResourceSpace.Has.ResourcesOfType<Customers>() .AtUri("/customers/region/{region}") ... // and so on ... where the {region} part of the path is automatically mapped to a string parameter in the handling method. So if the user hits: http://server/customers/region/emea Then the handler method is passed the string "emea". As well as doing this, I'd like to register a handler with something like this: ResourceSpace.Has.ResourcesOfType<Customers>() .AtUri("/someotherthing/*") ... // and so on In this imaginary syntax, the asterisk would mean "take the rest of the path, including slashes, to be a single string parameter to pass to the handling method". And so if the user hits: http://server/someotherthing/how/about/this?that=other Then my handler method receives a string parameter: how/about/this?that=other Is such a thing possible in OpenRasta? In Sinatra (Ruby) I'd use a regular expression to do exactly this.

    Read the article

  • Using Rails 3 and Haml 3, how do I configure Haml?

    - by dpogg1
    I'm using Rails 3.0.0.beta3 and Haml 3.0.0.rc.2, and I can't find where I need to place the configuration lines for Haml (nor what they are in the new version, for that matter). Using Rails 2.3.5 and Haml 2, I would do Haml::Template.options[:format] = :html5 in environment.rb. Or, in Sinatra, set :haml, {:format => :html5} in my main file. But in Rails 3 everything's been changed around, and no matter where I put that configuration line, I get an undefined method or undefined object error.

    Read the article

  • Why Shouldn't I Programmatically Submit Username/Password to Facebook/Twitter/Amazon/etc?

    - by viatropos
    I wish there was a central, fully customizable, open source, universal login system that allowed you to login and manage all of your online accounts (maybe there is?)... I just found RPXNow today after starting to build a Sinatra app to login to Google, Facebook, Twitter, Amazon, OpenID, and EventBrite, and it looks like it might save some time. But I keep wondering, not being an authentication guru, why couldn't I just have a sleek login page saying "Enter username and password, and check your login service", and then in the background either scrape the login page from say EventBrite and programmatically submit the form with Mechanize, or use an API if there was one? It would be so much cleaner and such a better user experience if they didn't have to go through popups and redirects and they could use any previously existing accounts. My question is: What are the reasons why I shouldn't do something like that? I don't know much about the serious details of cookies/sessions/security, so if you could be descriptive or point me to some helpful links that would be awesome. Thanks!

    Read the article

  • What tech stack/platform to use for a project?

    - by danny z
    Hey guys, This is a bit of a weird meta-programming question, but I've realized that my new project doesn't need a full MVC framework, and being a rails guy, I'm not sure what to use now. To give you a gist of the necessary functionality; this website will display static pages, but users will be able to log in and 'edit their current plans'. All purchasing and credit card editing is being handled by a recurring payment subscriber, I just need a page to edit their current plan. All of that will be done through (dynamic) XML API calls, so no database is necessary. Should I stick with my typical rails/nginx stack, or is there something I could use that would lighten the load, since I don't need the Rails heft. I'm familiar with python and PHP but would prefer not to go that route. Is Sinatra a good choice here? tl;dr: What's a good way to quickly serve mostly static pages, preferably in Ruby, with some pages requiring dynamic XML rendering?

    Read the article

  • Programmatically Download Image to Desktop from Remote App with Ruby?

    - by viatropos
    I was thinking about making a little crop/resize batch processor online, and wanted to know if there was a way for me to do the following: upload image and specify dimensions click "process" and app resizes image image downloads automatically to wherever it was I uploaded it (say from my desktop), but with a new name (based on the time for example). This would make it so I could host a free image processor that never stored any data other than tempfiles. Is that possible? Something like Rails' send_file method, but I'm using Sinatra and am looking for something in pure ruby.

    Read the article

  • Force Response to Download File(s) to Desktop with Ruby?

    - by viatropos
    I was thinking about making a little crop/resize batch processor online, and wanted to know if there was a way for me to do the following: upload image and specify dimensions click "process" and remote app resizes image image downloads automatically locally to wherever it was I uploaded it (say from my desktop), but with a new name (based on the time for example). This would make it so I could host a free image processor that never stored any data other than tempfiles. Is that possible? Something like Rails' send_file method, but I'm using Sinatra and am looking for something in pure ruby. What's the basic concept behind this? What if I wanted to do this for multiple files? Åssuming I can get multiple files uploaded no problem, how can I download all of them automatically?

    Read the article

  • Facebook user_id as MongoDB BSON ObjectId?

    - by MattDiPasquale
    I'm rebuilding Lovers on Facebook with Sinatra & Redis. I like Redis because it doesn't have the long (12-byte) BSON ObjectIds and I am storing sets of Facebook user_ids for each user. The sets are requests_sent, requests_received, & relationships, and they all contain Facebook user ids. I'm thinking of switching to MongoDB because I want to use it's geospatial indexing. If I do, I'd want to use the FB user ids as the _id field because I want the sets to be small and I want the JSON responses to be small. But, is the BSON ObjectId better (more efficient for MongoDB) to use than just an integer (fb user_id)?

    Read the article

  • Beginning with Datampper, Association question

    - by Ian
    I'm just diving into Datamapper (and Sinatra) and have a question about associations. Below are some models I have. This is what I want to implemented. I'm having an issue with Workoutitems and Workout. Workout will be managed separately, but Workoutitems has a single workout associated with each row. Workout - just a list of types of workouts (run, lift, situps, etc) Selected workout - this is the name of a set of workouts, along with notes by the user and trainer. It has a collection of N workoutitems Workoutitems - this takes a workout and a number of repetitions to it that go in the workout set. class Workout include DataMapper::Resource property :id, Serial #PK id property :name, String, :length=50,:required=true # workout name property :description, String, :length=255 #workout description end class Selectedworkout include DataMapper::Resource property :id, Serial property :name, String, :length=50, :required=true property :workout_time, String, :length=20 property :user_notes, String, :length=255 property :coach_notes, String, :length=255 has n, :workoutitems end class Workoutitem include DataMapper::Resource property :id, Serial property :reps, String, :length=50, :required=true belongs_to :selectedworkout end

    Read the article

  • what would be a good way to implement/render a 2d tiled map for a browser game?

    - by jj_
    I've made this little rpg ruby game I did while learning and now I'd like to make it into a browser game. I've already set up Sinatra framework to serve it, so what I am looking for, before everything else, is a way to represent the game map in browser (location attributes are stored in db). A new map is randomly generated by code for each new game at each game start. For now forget db, and let's say a map (say 100x100 "squares") is stored as a tridimensional array. (x,y, ...) Last "dimension" of array stores who & what is at that map cell: a player, a building, whatever. So all I have to do is render those "squares" or array cells to a 2d tiled map in the browser. The map does not need to refresh or be dynamically fetched as you scroll it, (at least at this stage of development) but, a technology which would allow me to do so in future would be a good reason for choosing it. Things that I thought of: html tables, html5 canvas, some js framework which is designed exactly with this purpose (which I do not know of = please advice). Yes I know about gamequery-js framework, but I've never used it, and I don't know if it's going to slow down everything down to inusability as I'm adding new features (scrolling, ajax). I really don't know of any other alternatives.. maybe there are lighter approaches? Easier or more minimalistic ways ? More targeted js framework which is the right tool for the job? Maybe just some html canvas code, or even simple image maps, or images with absolute positioning will be enough? The thing is I'd like to start simple, and then gradually make it better, so, as I said before, I'd prefer something that will give me room for improvement or is headed toward new web tendencies but which will also give me a bit of gratification in the beginning :) So.. advices are needed! And appreciated! :) Thanks p.s. Flash is excluded because I don't like it.

    Read the article

  • Extra, Extra, Read All About It- Offer Ends Soon!

    - by Kristin Rose
    Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Start spreading the news... Your partner news of course by submitting all interesting presentation ideas to the Oracle OpenWorld 2012 Call for Papers. Though you may not be able to serenade your customers with a voice like Sinatra’s, you can still get their attention by sharing your customer solutions, highlighting your achievements and attempting your best “Old Blue Eyes” impersonation. This call for papers will end April 9th, 2012 so don’t be a stranger in the night; instead fly your company to the moon and back by getting those papers in. May luck be a lady or simply on your side, as all accepted submission speakers will receive a complimentary pass to the event they have been accepted for. Yes you’re lovely, so why wait any longer? Join the Oracle OpenWorld 2012 ‘Rat Pack’ today by watching the video below or submitting to the call for papers. The best is yet to come, The OPN Communications Team

    Read the article

< Previous Page | 3 4 5 6 7 8  | Next Page >