|
I've been using Speedyrails, which is a managed VPS based service. Its actually pretty nice to have a managed VPS because you have all the freedom of root access with a safety net in place in case you really gently caress things up. They also handle regular patching and updates and provide you with a great Capistrano recipe to start which is nice
|
# ? Sep 1, 2010 03:28 |
|
|
# ? May 14, 2024 18:33 |
|
If you just want to learn how to write Rails apps (and are fine with staying with the exact components they offer) Heroku is, as mentioned, your best bet. If you want to learn how to administer a Rails-capable Web server (or want to work with a different set of tools) then you probably don't want to use Heroku because they abstract everything away for you. Basically, development vs operations/systems administration. If you definitely want to learn the systems side of Web dev, read on! Rackspace Cloud is probably the best combo of quality/price for virtual servers. You're charged pennies on the hour, which means if you spin up a new instance to play with Technology X and then decide to nuke it a day later, you've lost less than a dollar (and they often don't even bother charging for short-lived instances, in my experience.) And you can create/delete/update instances on the fly via a control panel. Amazon Web Services (EC2, S3 etc etc) is another, similar (and older, and more "enterprisey") setup, but it's a bit more work to cobble together a simple working server, and more expensive, at least on the low end. On the other hand, AWS experience is useful to have, career-wise. If you want a more "classic" VPS setup (heh...now I feel old. VPS as classic?) which gives you more "static" instances that are charged monthly, Linode or RimuHosting are excellent providers. Linode may also have a cloud-style control panel, though I think it's limited to reimaging a handful of specific instances -- i.e. you pay monthly for X amount of RAM/HDD space and might have to go through billing to spin up more servers. I'm sure some of the other posters can clarify this.
|
# ? Sep 1, 2010 03:32 |
|
bitprophet posted:If you just want to learn how to write Rails apps (and are fine with staying with the exact components they offer) Heroku is, as mentioned, your best bet. If you want to learn how to administer a Rails-capable Web server (or want to work with a different set of tools) then you probably don't want to use Heroku because they abstract everything away for you. Is there a middle ground? Is there somewhere for those of us who have rolled a few of our own apps, and dont' want to deal with some of the limitations that Heroku imposes, but aren't yet comfortable being system administrators? I am trying to learn and extend my experience with rails to the point that I find Heroku limiting, but don't want to divide my focus to learn the sysadmin side of things. If I went with linode or rimu I have to pick a distribution, and then update Ruby to the version I am using locally (on OSX) and then proceed to install/update Rails to whatever version I want and gem and git. Do most of things come standard on a certain *nix distro that is offered by those providers? When I gently caress things up, can I just flatten what I've done and start again? I guess I'd like a situation where I started similar to when I did on OSX. I had Ruby already baked in and rails as well, I just had to do some updating of a few things and I hate the latest and greatest and was able to go from there, but I'm not sure if my experience with Linode would be far more difficult than that.
|
# ? Sep 1, 2010 09:35 |
|
BrokenDynasty posted:Is there a middle ground? Is there somewhere for those of us who have rolled a few of our own apps, and dont' want to deal with some of the limitations that Heroku imposes, but aren't yet comfortable being system administrators? I am trying to learn and extend my experience with rails to the point that I find Heroku limiting, but don't want to divide my focus to learn the sysadmin side of things. The one I mentioned earlier, Speedyrails, is exactly this. They handle the day to day systems administration but you still have SSH admin access to get in there and mess around. Each VPS comes setup for one app with a mysql database, SMTP, and whatever gems you want them to pre-install. They give you a nice Capistrano recipe to deploy with as well. Your choice of Apache + Passenger (recommended) or Mongrel. Its full service so at any point you can email them to install or configure something for you. I emailed them from a junkyard the other day to install an SSL certificate and it was done with Apache restarted inside of 10 minutes. If you work at a company with a small development team its a huge boon to not have to hire sysadmins or babysit servers. 8ender fucked around with this message at 15:13 on Sep 1, 2010 |
# ? Sep 1, 2010 15:11 |
|
Nolgthorn posted:I believe the current rails 3 auth favourite is devise. http://github.com/plataformatec/devise I have yet to start any rails 3 apps, but am building a timetable to get some of my 2.3.5 apps over to 3 before the end of the year. Besides the obvious devise blog and railscasts for information, does anyone know of an awesome blog post or tutorial on migrating from Authlogic to Devise?
|
# ? Sep 1, 2010 19:21 |
|
UxP posted:I have yet to start any rails 3 apps, but am building a timetable to get some of my 2.3.5 apps over to 3 before the end of the year. Besides the obvious devise blog and railscasts for information, does anyone know of an awesome blog post or tutorial on migrating from Authlogic to Devise? The README on the github page says: "Devise implements encryption strategies for Clearance, Authlogic and Restful-Authentication." Authlogic is really nice but the main benefit of devise is that it seems pretty customisable.
|
# ? Sep 1, 2010 22:06 |
|
Hopefully can someone help a Rails newb here. My boss wanted me to learn Ruby on Rails for some of his various sites that were written in it. While I'm not having a too too hard pickup up the basics, his first demand was that I make it so you could access a beta site on the same server. The server is setup as: / --ruby/ -----beta/ -----gfw/ it uses the gfw directory by default to view the site since that's what was installed first I guess (again, I'm rather new to rails so I'm not completely sure either). Obviously sticking beta as a subdirectory doesn't work (unless there's a way to allow it to go to subdomains instead of serving up a 404 error. So how could I make http://www.websitedomain.com/beta go to the beta directory instead of giving me a drat 404 error is the question.
|
# ? Sep 9, 2010 00:21 |
|
Master_Odin posted:So how could I make http://www.websitedomain.com/beta go to the beta directory instead of giving me a drat 404 error is the question. If you're talking separate rails apps, you're going to need to have port 80 on websitedomain.com be served by nginx or apache (or whatever), then proxy /beta and /gfw to the correct apps. The easy way to go here is passenger and I recommend nginx over apache, but it doesn't really matter. edit: and just for a pitty story, tomorrow is going to be a day in the debugger for me Updated our app to rails 3 and now authlogic works great in development and test and celerity environments, but doesn't work in qa or production environments
|
# ? Sep 9, 2010 01:06 |
|
I'm using jruby with jetty (without rails or rack or anything) and I keep hearing conflicting things about how threading works. Does anyone have a link to somewhere with a good summary about what you can and can't do with jruby in a threaded concurrent environment? In particular, what about transporting ruby or java objects between threads? cultureulterior fucked around with this message at 16:30 on Sep 9, 2010 |
# ? Sep 9, 2010 10:19 |
|
I've got a quick question that I can't seem to find the answer to via Google or irc... I'm running Rails 3.0.0 and I've got a class in the lib directory which is required from environment.rb. I'm trying to use the Rails logger (i.e. Rails.logger.info "foo") inside that class, but when I try to start the console or the server, I get code:
|
# ? Sep 9, 2010 20:14 |
|
Apparently I can't even make something as simple as a mail form. So I've got two files for it contact_controller.rb, notifier.rb. Contact controller is a simple: code:
My routes for it: code:
code:
|
# ? Sep 9, 2010 20:46 |
|
Ace McLamesauce posted:I've got a quick question that I can't seem to find the answer to via Google or irc... Can you move it to vendor/plugins instead of lib? Using lib has been discouraged since like... 1.0 and probably has a different load order.
|
# ? Sep 9, 2010 21:49 |
|
Master_Odin posted:
No one really writes routes that specific. Rails makes it easy if you use the RESTful conventions. You could get all the routes you need by writing: code:
|
# ? Sep 10, 2010 22:47 |
|
B1axident posted:No one really writes routes that specific. Rails makes it easy if you use the RESTful conventions. You could get all the routes you need by writing: I just want to say that this sort of thing has been the hardest for me coming from a Java background to Ruby. I'm trained to default to the most complex solution and I have built up a huge tolerance for bullshit so I often never even consider that things could or should be easier. Just the other day I recreated most of the x.sum(:thing) function in some of my code before I checked the docs 8ender fucked around with this message at 07:42 on Sep 11, 2010 |
# ? Sep 11, 2010 07:39 |
|
Master_Odin posted:any help on the issue since it has to be something obvious I'm sure would be appreciated! code:
|
# ? Sep 11, 2010 07:48 |
|
To everyone asking about servers and managed hosting, I highly recommend moonshine: http://github.com/railsmachine/moonshine for managing your own servers. It's really easy to install and configure everything and if you're using a vps you can always roll back pretty easily.
|
# ? Sep 16, 2010 18:12 |
|
So, that Diaspora project about making an OSS, decentralized Facebook replacement went public for developer contributions today. It's written in Rails 3. The base code is pretty nice to work with so far. They need lots of help. Go for it! http://github.com/diaspora/diaspora e: christ, one of the dependencies doesn't work on 1.9.2 ffffffff ee: nevermind, this is a huge loving trainwreck and it'll probably fail. This is very obviously '4 kids with some basic knowledge and 200,000 dollars try to do something cool'. There is no design documentation, no direction, the internals are a loving mess and nobody has any idea what to do with it because these 4 kids don't know what the gently caress they're doing with it. NotShadowStar fucked around with this message at 02:05 on Sep 17, 2010 |
# ? Sep 17, 2010 01:04 |
|
NotShadowStar posted:ee: nevermind, this is a huge loving trainwreck and it'll probably fail. This is very obviously '4 kids with some basic knowledge and 200,000 dollars try to do something cool'. There is no design documentation, no direction, the internals are a loving mess and nobody has any idea what to do with it because these 4 kids don't know what the gently caress they're doing with it. I had sort of written off the whole thing as an architecture astronaut adventure when I first heard about it. Let's tally up the three main warning signs: - Going way out of their way to make it "distributed" and "decentralized" - Development team is 4 mathematicians working from academia - Okay so the third, backing from Ray Ozzie, hasn't happened yet. You can be assured that he knows about this though and is probably flying a helicopter to New York right now.
|
# ? Sep 17, 2010 14:23 |
|
I'm going to have read-only access to a remote Oracle database, and I need to pull some of the tables from it into a different database on a regular basis. Anyone know of an existing gem that will let me do this? taps was my first thought, but it looks like I need to have the taps gem installed and running on the remote server in order to make the connection, and that's not going to be possible. Many other export/import scripts I have found are MySQL specific.
hmm yes fucked around with this message at 18:26 on Sep 18, 2010 |
# ? Sep 18, 2010 18:21 |
|
atastypie posted:I'm going to have read-only access to a remote Oracle database, and I need to pull some of the tables from it into a different database on a regular basis. Anyone know of an existing gem that will let me do this? taps was my first thought, but it looks like I need to have the taps gem installed and running on the remote server in order to make the connection, and that's not going to be possible. Many other export/import scripts I have found are MySQL specific. Is writing a migration out of the question?
|
# ? Sep 18, 2010 19:01 |
|
NotShadowStar posted:So, that Diaspora project about making an OSS, decentralized Facebook replacement went public for developer contributions today. It's written in Rails 3. The base code is pretty nice to work with so far. They need lots of help. Go for it! Just leave it to google
|
# ? Sep 18, 2010 19:32 |
|
BrokenDynasty posted:Is writing a migration out of the question? No, I could write a migration. I can have access the database with a rails app if it's purpose is to export/sync the data.
|
# ? Sep 18, 2010 20:16 |
|
Whats the best way to install Ruby Gems and then Rails on an ubuntu server? My boss is telling me to install gems from source because apt-get fucks it up and is out of date so gems cant update it self or install new gems. Confirm/Deny
|
# ? Sep 24, 2010 14:50 |
|
rugbert posted:Whats the best way to install Ruby Gems and then Rails on an ubuntu server? My boss is telling me to install gems from source because apt-get fucks it up and is out of date so gems cant update it self or install new gems. Confirm/Deny
|
# ? Sep 24, 2010 14:58 |
|
Obsurveyor posted:Use rvm. Ubuntu's package management for ruby sucks balls. This. The default Debian/Ubuntu Ruby interpreter itself tends to work fine, it's the gems that has the big bruhaha surrounding it, so I typically aptitude install ruby1.8 ruby1.8-dev ri irb etc etc but don't include rubygems here and then install rubygems from source (grab tgz, unpack, ruby setup.rb install). RVM has a bunch of neat features like gemsets, though, and makes it stupid easy to manage different Ruby versions. So if your server is going to host multiple apps, especially ones that might need different Ruby versions among them, it's totally the way to go.
|
# ? Sep 24, 2010 23:05 |
|
I swear that sometime in the last month I read something about a new rails 3 engine or app that acted like django-admin. Any help? edit: hurrr http://github.com/sferik/rails_admin dustgun fucked around with this message at 20:16 on Sep 26, 2010 |
# ? Sep 26, 2010 20:06 |
|
I have what is I'm sure an absurdly newbie question to ask, but I just started learning RoR for work, and I've been trying to work in a feature where a user can enter Time and Date in two form text fields, and they get combined into a datetime to be stored in the database. Everything works fine if they're correct, but I'm having trouble with the error handling. I use the Time.parse method, which is supposed to throw an ArgumentError if you pass it in something it can't make a time value out of, but when I throw it nonsense, it seems to just default to the current day instead of throwing an error. With the following code, code:
code:
|
# ? Oct 6, 2010 14:59 |
|
I'm only a casual Ruby user, but I think you have to surround the code you want to trap errors from in a begin/rescue/end block:code:
|
# ? Oct 6, 2010 15:13 |
|
Flobbster posted:I'm only a casual Ruby user, but I think you have to surround the code you want to trap errors from in a begin/rescue/end block: Thanks for the help. Unfortunately, I've tried that and it doesn't seem to make a difference. I'm pretty sure that if you have a rescue statement at the end of the method it by default rescues all the code in the method. Anyway, if the rescue block wasn't working, it should still throw an error and just make the application break, which it isn't doing. I put in another puts statement inside the rescue block just to check if an error even got thrown and was just handled inappropriately, and the error doesn't even get thrown. I don't understand why Time.parse isn't throwing an error when I ask it to parse 'NOT A DATE'. Anybody have any ideas or experience with a similar error?
|
# ? Oct 6, 2010 15:31 |
|
SamMalone posted:Thanks for the help. Unfortunately, I've tried that and it doesn't seem to make a difference. I'm pretty sure that if you have a rescue statement at the end of the method it by default rescues all the code in the method. Ah, it does appear that's the behavior. Cool, I learned something new! I'm seeing the same behavior that you are on Ruby 1.8.7 on Mac OS X 10.6. According to one poster here, it looks like the raising ArgumentError behavior wasn't added until 1.9.2, unfortunately.
|
# ? Oct 6, 2010 16:27 |
|
1) When dealing with data in models, don't use exceptions, use validators. 2) There is a DateTime class that you should probably use instead of making a Date and a Time and then combining them if you are, in fact, storing a date and time in a database field. 3) Somebody already did this for you http://github.com/adzap/validates_timeliness/
|
# ? Oct 6, 2010 16:31 |
|
blah, that's no good. Unfortunately I'm not supposed to update my version just yet. Anyway, apparently there's a work around if anyone's in a similar situation. For some reason, Time.zone.parse() will return nil if its unable to parse, i.e. it actually checks correctly. So in Ruby 1.8.6, you can check for errors with something like this code:
SamMalone fucked around with this message at 16:52 on Oct 6, 2010 |
# ? Oct 6, 2010 16:50 |
|
Anyone have a good tutorial for how routing works? Super noob right here and my boss is too boring to listen too.
|
# ? Oct 7, 2010 17:15 |
|
rugbert posted:Anyone have a good tutorial for how routing works? Super noob right here and my boss is too boring to listen too. http://guides.rubyonrails.org/routing.html All of http://guides.rubyonrails.org is great.
|
# ? Oct 7, 2010 17:59 |
|
Pardot posted:http://guides.rubyonrails.org/routing.html Thanks!
|
# ? Oct 12, 2010 17:08 |
|
So I have a not-very Googleable question about Rails' capabilities. I've not built a full site yet, but I'm hoping to build a new development on Rails. I have some SQL Server tables like so: code:
Any insight as to whether this is even possible in Rails (ideally more-so than post-submission) would be appreciated.
|
# ? Oct 13, 2010 21:07 |
|
You're thinking about it like PHP. Never do validation in controllers or views, let the model do the work. It sounds like you want an association though, which are mostly automatic if done right. Can you be more specific on the data? We could help you much better on the design.
|
# ? Oct 13, 2010 21:20 |
|
NotShadowStar posted:You're thinking about it like PHP. Never do validation in controllers or views, let the model do the work. Sure. What I have are a number of tables in various databases that contain non-presentable data (some data has to be shortened to make it fit the system tables, but we want to present it on the web or various documents. Rather than duplicate the data, we're building a system that generates SQL views based on the original, dirty, table coupled with this "override" table. This will be the presentable face of the underlying tables, with all the rough data tidied over. All the Ruby app will be for is providing a front-end for adding and editing these overrides. I just want to be sure that when you add an override for, for example, a person's name, the result is validated as a varchar, and when you provide an integer for an age, it's validated as an integer, even though both the name and the integer are held as varchar values in the "override" table. I've been working with PHP a lot recently and feel stupid for not thinking about this as the work of the model. I was hoping to just slap Rails onto the existing table structures and then do some work on the validation side so it doesn't just naively validate everything as a string. All the relationships are sound. I'm just not sure how to tell Rails that the validation rules on a certain field are based on the value of a related field. Is this enough info to get across what I'm trying to do?
|
# ? Oct 13, 2010 22:14 |
|
Flamadiddle posted:I was hoping to just slap Rails onto the existing table structures This is pain. You can do it, but it's full of pain especially if you are very new to ActiveRecord. ActiveRecord works best if you follow its conventions. AR is full of 'convention over configuration' and that includes table and column names for automatic class, property and association matching. You can override all of these but it becomes more confusing if you're not already familiar with AR. What I would suggest you do is not deal with the existing table structure at first and create a whole new scratch Rails app with the perfect data model you have in mind for your existing structure and follow the Rails/AR conventions. Forget about the 'dirty' table and associations and just take what the best way of modeling the data is and build up a new Rails app from scratch. If you can give a few examples on how you want this to look disregarding all the complicated mess we can help you model your example application. Or, alternately, do the example project in this book. You'll understand Rails a lot better. Actually if you have Python experience Django might serve you better, it's model structure doesn't depend so much on the automatic associations as you define everything. NotShadowStar fucked around with this message at 23:02 on Oct 13, 2010 |
# ? Oct 13, 2010 22:54 |
|
|
# ? May 14, 2024 18:33 |
|
Thanks for the advice. Yeah, I'm sure the way we've built our demo system isn't particularly suited for ActiveRecord and we're looking at reworking it. In an object-oriented way, I'd imagine the solution would involve having an abstract override class, with concrete child classes for each datatype. In Rails, would I then be able to say that a Column object has many Override members, but that these may be of different types as defined by the specific subclass, and have the model validate against these?
|
# ? Oct 14, 2010 09:25 |