For a project I used the gem ''event_calendar''. However, there were a couple things I had to manually change within the gem source to suit my needs. How would I go about to deploy this in production ''the rails way''? Right now I have just replaced the sourcecode of the gem installed on my production environment. This is ofcourse unmanageble over time if I ever have to reinstall (bundle install) on a new production environment -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
The 21/03/12, C@eq4.andreas-s.net wrote:> For a project I used the gem ''event_calendar''. However, there were a > couple things I had to manually change within the gem source to suit my > needs. > > How would I go about to deploy this in production ''the rails way''? Right > now I have just replaced the sourcecode of the gem installed on my > production environment. This is ofcourse unmanageble over time if I ever > have to reinstall (bundle install) on a new production environmentThe best is to get your patches merged by upstream. Of course, this might ask rework of your local changes. Once merged, you will have less maintenance work and others might benefit from your changes. If it''s really not possible (which I tend to not believe), the way to maintain and deploy your own gems depends on the number of systems where you have to deploy it. -- Nicolas Sebrecht -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 21 March 2012 02:45, <C@eq4.andreas-s.net> wrote:> For a project I used the gem ''event_calendar''. However, there were a > couple things I had to manually change within the gem source to suit my > needs. > > How would I go about to deploy this in production ''the rails way''?A few choices: * Vendorize it * Package your own gem from the altered code * Monkey-patch the gem in your lib folder There''s probably more options. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
monkey patch +1 vendorize isn''t good choice for maintenance. Use AOP with include module chain methology(http://stackoverflow.com/questions/3689736/rails-3-alias-method-chain-still-used) not alias_method_chain. 2012년 3월 21일 수요일 오전 11시 45분 59초 UTC+9, (알 수 없음) 님의 말:> > For a project I used the gem ''event_calendar''. However, there were a > couple things I had to manually change within the gem source to suit my > needs. > > How would I go about to deploy this in production ''the rails way''? Right > now I have just replaced the sourcecode of the gem installed on my > production environment. This is ofcourse unmanageble over time if I ever > have to reinstall (bundle install) on a new production environment > > -- > Posted via http://www.ruby-forum.com/. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/pACXAe4YmtkJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 20, 9:45 pm, C...-waraztKb0Ug5yGfNe//zul6hYfS7NtTn@public.gmane.org wrote:> > How would I go about to deploy this in production ''the rails way''?If you''re using bundler (which you should be), then you can: 1) Fork the gem and checkout that fork 2) Make your modifications to your fork (include tests if possible) and push back to origin. 3) Update bundler to pull from your forked repository instead of rubygems for that particular gem: gem ''event_calendar'', :git => ''git://github.com/your_account_name/ event_calendar.git'' This way you have an authoritative version of your changes to the gem on github that your project can answer, and you can use the power of git to merge in upstream changes, etc. as you go along. And if it makes sense you can make a Pull Request so you no longer need to maintain the code. A side note, since your fork is public if you want to do more local integration testing in #2 before pushing it back to origin you can point bundler at a local git repository too: gem ''event_calendar'', :git => ''/some/path/to/local/checkouts/ event_calendar'' And that way you can make changes, rebase, etc. locally to get everything happy, and then when ready push to origin and update your Gemfile. \Peter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling wrote in post #1052592:> On 21 March 2012 02:45, <C@eq4.andreas-s.net> wrote: >> For a project I used the gem ''event_calendar''. However, there were a >> couple things I had to manually change within the gem source to suit my >> needs. >> >> How would I go about to deploy this in production ''the rails way''? > > A few choices: > > * Vendorize it > * Package your own gem from the altered code > * Monkey-patch the gem in your lib folder > > There''s probably more options.Thanks for all the replies. I decided to go with vendorizing the gem, since the changes were so application specific I did not want to deploy the modified gem apart from the application. Running into the following problem now though. Whenever I load the model that uses some of the gem functionality, I get this error: NoMethodError: undefined method `has_event_calendar'' for #<Class:0x45e2308> The line in the gemfile reads: gem ''event-calendar'', :require => ''event_calendar'', :path => ''vendor/gems/event-calendar-2.3.3'' When I go into the console, I do seem to have access to the gem''s namespace (for example, EventCalendar module is known) What am I doing wrong? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ignore that last post... I discovered something went wrong with the vendorization of the gem and files did not end up in the correct location. Its working now. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.