Ah, gotcha. I'm just intermediate at Linux admin, so I'm not sure how that all works with multiple users.
Are you running multiple apache daemons? Would I create a www root in my user folder and have you put a symlink somewhere else? Are you handling the site config files, or do we have access to a2ensite and the like?
This is why I'm offering the service!
As for Apache, it is one daemon that serves requests under your user context. You get username.padev.net setup for you automatically at /var/www/username.padev.net/ and you can get me to setup more complicated vhosts for you.
Admanb, I just wanted to thank you for your help. Because of you, the basic elements of my first game are almost done. I plan on adding other things and possible a graphical interface (nothing fancy, just pictures). Again, thank you so much .
cd ~
rails new MyApp --skip-bundle
cd MyApp
bundle install --path vendor/bundle
rails server
What this does is allow you to specify where to install your gems for the application. Useful since version differences can screw others over, and you don't need any root access since you're not sharing.
I'll update the howto if this gets you up and running finally. It's working for my dummy user.
edit: Also just fyi, once you specify the --path on the initial setup there, you just use the bundle commands exactly as before. It caches the path, if you want to remove the path and go back to system default (you don't here but hey) you use bundle install --system.
[2036][infidel@carbon:~]$ padev-newrails Apptastic
Will create new Rails application in /home/infidel/rails/Apptastic
and link to /var/www/infidel.padev.net/Apptastic
URL: http://infidel.padev.net/Apptastic
Continue?
Pretty much does everything that was in the guide and my previous post. :P
I have RVM installed now (no system Ruby, cleared it all out and started over) and the default is 1.9.3.
If anyone needs to know how it works, please see the RVM docs. :rotate:
But the main part is it allows switching of your ruby environment and creation of personal rubies (ruby interpreters, diff versions or diff vendors even) and gemsets etc.
You shouldn't need to do anything if you want to use 1.9.3 and the shared default gemset. 'gem list' should show what is installed, 'bundle install' works without specifying your own path (although you still can if you want to ensure/specify your own versions of gems, you can also do this with RVM itself so read up on it) etc.
So 'rails new Blah' should work 100% out of the box now.
Important note: Passenger runs as one Ruby system, so it is running as 1.9.3. It is configured Apache side so you cannot change it using RVM, so don't pull your hair out trying to do so. If you need a Rails running on 1.8.7 then we'll have to setup a domain specifically for you and reverse-proxy it. I'd heavily recommend going with 1.9.3 if at all possible.
padev-newrails is still there but pretty simple now, all it will do extra is create the symlink and .htaccess directive in your user.padev.net web root for you. It works if you want to use it.
I have RVM installed now (no system Ruby, cleared it all out and started over) and the default is 1.9.3.
If anyone needs to know how it works, please see the RVM docs. :rotate:
But the main part is it allows switching of your ruby environment and creation of personal rubies (ruby interpreters, diff versions or diff vendors even) and gemsets etc.
You shouldn't need to do anything if you want to use 1.9.3 and the shared default gemset. 'gem list' should show what is installed, 'bundle install' works without specifying your own path (although you still can if you want to ensure/specify your own versions of gems, you can also do this with RVM itself so read up on it) etc.
So 'rails new Blah' should work 100% out of the box now.
Important note: Passenger runs as one Ruby system, so it is running as 1.9.3. It is configured Apache side so you cannot change it using RVM, so don't pull your hair out trying to do so. If you need a Rails running on 1.8.7 then we'll have to setup a domain specifically for you and reverse-proxy it. I'd heavily recommend going with 1.9.3 if at all possible.
padev-newrails is still there but pretty simple now, all it will do extra is create the symlink and .htaccess directive in your user.padev.net web root for you. It works if you want to use it.
rails new (and padev-rails) still have an issue (i assume becuase it's trying to do the run bundle install)
create vendor/plugins/.gitkeep
run bundle install
Enter your password to install the bundled RubyGems to your system:
weretaco is not in the sudoers file. This incident will be reported.
Hey, smart people. Design pattern for dealing with errors in asynchronous code - no throw/catch allowed.
It's very, very ugly to have an err parameter in every callback(especially if the chain stretches), but that's pretty much what I'm stuck with. Am I missing something?
Hey, smart people. Design pattern for dealing with errors in asynchronous code - no throw/catch allowed.
It's very, very ugly to have an err parameter in every callback(especially if the chain stretches), but that's pretty much what I'm stuck with. Am I missing something?
I know in GWT all callBacks have to implement two functions
public void onFailure(Throwable caught)
public void onSuccess(<> result)
Hey, smart people. Design pattern for dealing with errors in asynchronous code - no throw/catch allowed.
It's very, very ugly to have an err parameter in every callback(especially if the chain stretches), but that's pretty much what I'm stuck with. Am I missing something?
I know in GWT all callBacks have to implement two functions
public void onFailure(Throwable caught)
public void onSuccess(<> result)
Works well.
What I was considering doing was implementing a success/failure object, but I was unable to see the actual benefit. It doesn't save me the ugly test.
It's probably an accepted way to work, I'm just not used to it, so for some reason find it revolting.
I just spent a days worth of work debugging a single error in a relatively simply piece of code that I wrote. It was just a class to store a two-dimensional array of values and interpolate those values for arbitrary coordinates, so that they could be used to simulate sensor readings off of a continuous field.
It mostly worked, but for large fields some of the stored values were reading as very large, very tiny, or nan. I checked pretty much everything related to how the values were initially generated, how they were passed into the class, how they were stored within the class itself, and how they were read, but came up with nothing.
And then I noticed that my constructor was doing a shallow copy of the passed in array. That was an embarrassingly pathetic waste of my time.
I hacked up RVM a bit and now have a way to install Ruby versions and gem as root (for Passenger to execute under) and keep user installs separate. Everything except the Ruby binaries are stored in ~/.rvm now. You don't need to really worry about the guts of that, just pointing out what is going on.
A user who hasn't run RVM will have no ruby command. You won't have ruby and the related binaries until you execute 'rvm use 1.9.3' or 'rvm use 1.8.7' which sets up your shell for using that version. I recommend you use 1.9.3, especially if you're hosting Rails, because that is what Passenger is running your Rails applications as and it can't be overridden there with RVM.
The shell will reset and forget about Ruby unless you make a version default like so: rvm use 1.9.3 --default
Now you have your own private Ruby. 'gem list' will show no local gems, etc. You can break shit as you please and no one can mess with your install.
Start off installing Rails with: gem install rails
Easy enough. Now while you could use 'rails new App' you don't want to if you want to host through Passenger. The problem is that if you let it do the default, it will run 'bundle install' which puts the gems for your application in your user's local gems. Passenger won't find them and you'll get errors about "bundler can't find rake" and so on.
So use the script I made, 'padev-newrails App' and it will link everything up for you. As mentioned before, it does --skip-bundle and then calls bundle to install to a path within your application. Passenger will pick this up automatically so you don't need to do anything special.
That means that if you want to install a gem for your local Ruby, use 'gem install' but for the Rails applications make sure to install them to the application itself.
I hope this explains the setup and works for you, @weretaco and whoever else wants to play with Rails. :^:
do it right the first time, even if it takes longer.
The only thing I really am able to get out of this is the experience and knowledge, so it makes little sense to not do it right, yeah.
That said, I learned more about Rails/RVM than I want, no more for now. This takes a bit more space since users have their own copies of many things, but at least it's secure (let me know if there's a flaw?) and user-managed.
Installed Boost, have most of the common source control tools on there, if anything found lacking keep asking for it.
Hey, help me translate my math class into programming so that I can understand it. I understand the math itself fine, I'm just not 100% clear on what math I'm being asked to do.
If I've got f(x) = 3x-2 and f(x-h) then that translates to this in code:
def f(x):
3x-2
x = 3
h = 1
f(x-h)
So f(x) = 3x-2 defines the actual function and that is the base of the function. Anything else is saying to use that same function but just modifying the parameter being passed in, right? The f(x) and passing a value into that is not an issue because that's exactly what I do all day, I just didn't immediately grasp what f(x-h) actually meant with the way my trig book explained it.
Posts
This is why I'm offering the service!
As for Apache, it is one daemon that serves requests under your user context. You get username.padev.net setup for you automatically at /var/www/username.padev.net/ and you can get me to setup more complicated vhosts for you.
Definitely, this is the kind of thing people should request, as opposed to just silently building and installing a client in your home directory.
Because then everyone will do that and that's just dumb.
Will install some more stuff when I get home.
I hate you certificates
Do you have certificate authentication on for ssh?
Yes of course, your private key is generated automatically and already setup to be used for identification. See ~/.ssh it is the usual deal.
For some reason putty is hating that key.
Unable to use key file "C:\Users..." (SSH-1 private key)
I also tried adding a id_rsa generated one with cygwin to my authorized_keys but no go...
Did some converting an got it up now.
I hate key formats
You need to use puttygen to put it in a format it can use. I tried to do it but the server is refusing the key, not sure why
You poor man....
Try this:
What this does is allow you to specify where to install your gems for the application. Useful since version differences can screw others over, and you don't need any root access since you're not sharing.
I'll update the howto if this gets you up and running finally. It's working for my dummy user.
edit: Also just fyi, once you specify the --path on the initial setup there, you just use the bundle commands exactly as before. It caches the path, if you want to remove the path and go back to system default (you don't here but hey) you use bundle install --system.
Pretty much does everything that was in the guide and my previous post. :P
A one-liner?
Done.
Awesome.. now to figure out why this guided rails app wont' work and I'll let you know how the script works.
Multi-user makes everything more exciting!
I am in the process of getting RVM working so that people/projects can pick and choose ruby versions and such. Wish me luck!
(by the end of this I'm going to be a Rails Hostmaster)
I can't wait until @Infidel has a wife and kids and 60 hours a week so that I don't have to feel so lazy by comparison!
I release at another hospital next week and I'll be on-site, I am handling a few side projects, and I am in the middle of incorporation!
Also, I'm trying to fit in some SWTOR.
It is a very good thing I don't have a family right now.
Aptana gets a little crashy when things go a little wrong and leaves behind a whack of processes to close myself.
Totally not my fault >.> <.<
I have RVM installed now (no system Ruby, cleared it all out and started over) and the default is 1.9.3.
If anyone needs to know how it works, please see the RVM docs. :rotate:
But the main part is it allows switching of your ruby environment and creation of personal rubies (ruby interpreters, diff versions or diff vendors even) and gemsets etc.
You shouldn't need to do anything if you want to use 1.9.3 and the shared default gemset. 'gem list' should show what is installed, 'bundle install' works without specifying your own path (although you still can if you want to ensure/specify your own versions of gems, you can also do this with RVM itself so read up on it) etc.
So 'rails new Blah' should work 100% out of the box now.
Important note: Passenger runs as one Ruby system, so it is running as 1.9.3. It is configured Apache side so you cannot change it using RVM, so don't pull your hair out trying to do so. If you need a Rails running on 1.8.7 then we'll have to setup a domain specifically for you and reverse-proxy it. I'd heavily recommend going with 1.9.3 if at all possible.
padev-newrails is still there but pretty simple now, all it will do extra is create the symlink and .htaccess directive in your user.padev.net web root for you. It works if you want to use it.
rails new (and padev-rails) still have an issue (i assume becuase it's trying to do the run bundle install)
create vendor/plugins/.gitkeep
run bundle install
Enter your password to install the bundled RubyGems to your system:
weretaco is not in the sudoers file. This incident will be reported.
Also "which bundle"
It's very, very ugly to have an err parameter in every callback(especially if the chain stretches), but that's pretty much what I'm stuck with. Am I missing something?
I know in GWT all callBacks have to implement two functions
Works well.
You could imitate try catch with queues but that's probably a lot more work, and you'd probably run into concurrency issues in rare circumstances?
What I was considering doing was implementing a success/failure object, but I was unable to see the actual benefit. It doesn't save me the ugly test.
It's probably an accepted way to work, I'm just not used to it, so for some reason find it revolting.
It mostly worked, but for large fields some of the stored values were reading as very large, very tiny, or nan. I checked pretty much everything related to how the values were initially generated, how they were passed into the class, how they were stored within the class itself, and how they were read, but came up with nothing.
And then I noticed that my constructor was doing a shallow copy of the passed in array. That was an embarrassingly pathetic waste of my time.
I hacked up RVM a bit and now have a way to install Ruby versions and gem as root (for Passenger to execute under) and keep user installs separate. Everything except the Ruby binaries are stored in ~/.rvm now. You don't need to really worry about the guts of that, just pointing out what is going on.
A user who hasn't run RVM will have no ruby command. You won't have ruby and the related binaries until you execute 'rvm use 1.9.3' or 'rvm use 1.8.7' which sets up your shell for using that version. I recommend you use 1.9.3, especially if you're hosting Rails, because that is what Passenger is running your Rails applications as and it can't be overridden there with RVM.
The shell will reset and forget about Ruby unless you make a version default like so: rvm use 1.9.3 --default
Now you have your own private Ruby. 'gem list' will show no local gems, etc. You can break shit as you please and no one can mess with your install.
Start off installing Rails with: gem install rails
Easy enough. Now while you could use 'rails new App' you don't want to if you want to host through Passenger. The problem is that if you let it do the default, it will run 'bundle install' which puts the gems for your application in your user's local gems. Passenger won't find them and you'll get errors about "bundler can't find rake" and so on.
So use the script I made, 'padev-newrails App' and it will link everything up for you. As mentioned before, it does --skip-bundle and then calls bundle to install to a path within your application. Passenger will pick this up automatically so you don't need to do anything special.
That means that if you want to install a gem for your local Ruby, use 'gem install' but for the Rails applications make sure to install them to the application itself.
I hope this explains the setup and works for you, @weretaco and whoever else wants to play with Rails. :^:
Gotta figure out something that will work longterm too.
The only thing I really am able to get out of this is the experience and knowledge, so it makes little sense to not do it right, yeah.
That said, I learned more about Rails/RVM than I want, no more for now. This takes a bit more space since users have their own copies of many things, but at least it's secure (let me know if there's a flaw?) and user-managed.
Installed Boost, have most of the common source control tools on there, if anything found lacking keep asking for it.
If I've got f(x) = 3x-2 and f(x-h) then that translates to this in code:
So f(x) = 3x-2 defines the actual function and that is the base of the function. Anything else is saying to use that same function but just modifying the parameter being passed in, right? The f(x) and passing a value into that is not an issue because that's exactly what I do all day, I just didn't immediately grasp what f(x-h) actually meant with the way my trig book explained it.